Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 26th Dec 2013, 01:55 AM   #1
Warrior Member
 
Join Date: 2013
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default
unlink and unset in PHP
Share on: 
fb share twitter share gplus share more share

Hi,

Please anyone tell me what is the difference between the functions unlink and unset?

Thanks,
Roger,
connected commerce
rogerlegend is offline  
Unread 26th Dec 2013, 02:03 AM   #2
Web Developer
War Room Member
 
Andrew H's Avatar
 
Join Date: 2012
Location: Vancouver, BC
Posts: 593
Thanks: 149
Thanked 162 Times in 133 Posts
Default
Re: unlink and unset in PHP
Share on: 
fb share twitter share gplus share more share

People who post questions that clearly have done no research should have their sig link removed. If you posted that question into google instead you would have received an answer much easier... but then you wouldn't get your sig link exposure...

"You shouldn't come here and set yourself up as the resident wizard of oz."
Andrew H is offline  
The Following User Says Thank You to Andrew H For This Useful Post:
Unread 26th Dec 2013, 02:51 AM   #3
IM Rocks!
War Room Member
 
shahriyar's Avatar
 
Join Date: 2010
Location: USA
Posts: 501
Thanks: 52
Thanked 65 Times in 60 Posts
Arrow
Re: unlink and unset in PHP
Share on: 
fb share twitter share gplus share more share

Originally Posted by rogerlegend View Post

Hi,

Please anyone tell me what is the difference between the functions unlink and unset?
unlink - Deletes a File (http://www.php.net/unlink)
unset - Destroys a Variable (http://www.php.net/unset)

PHP.net is your buddy.

shahriyar is offline  
Unread 26th Dec 2013, 03:18 AM   #4
Warrior Member
 
Join Date: 2013
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: unlink and unset in PHP
Share on: 
fb share twitter share gplus share more share

Hi shahriyar,

Thanks, I am new to php. I think php.net site is very helpful for me to learning. Is there any other sites to easily learn PHP ?

Luke Wright,
connected commerce
lukewright is offline  
Unread 26th Dec 2013, 03:33 AM   #5
IM Rocks!
War Room Member
 
shahriyar's Avatar
 
Join Date: 2010
Location: USA
Posts: 501
Thanks: 52
Thanked 65 Times in 60 Posts
Arrow
Re: unlink and unset in PHP
Share on: 
fb share twitter share gplus share more share

Originally Posted by lukewright View Post

Hi shahriyar,

Thanks, I am new to php. I think php.net site is very helpful for me to learning. Is there any other sites to easily learn PHP ?
Hello Luke, checkout these links =>
http://www.w3schools.com/

Very good video tutorials (free),
http://thenewboston.org/list.php?cat=11

shahriyar is offline  
Unread 26th Dec 2013, 03:43 AM   #6
Warrior Member
 
Join Date: 2013
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: unlink and unset in PHP
Share on: 
fb share twitter share gplus share more share

Thanks shahriyar. i think easy to learn w3schools.com site. thanks again for help...

Luke Wright,
connected commerce
lukewright is offline  
Unread 26th Dec 2013, 03:58 AM   #7
IM Rocks!
War Room Member
 
shahriyar's Avatar
 
Join Date: 2010
Location: USA
Posts: 501
Thanks: 52
Thanked 65 Times in 60 Posts
Default
Re: unlink and unset in PHP
Share on: 
fb share twitter share gplus share more share

Your are very welcome. Happy Holidays!

shahriyar is offline  
Unread 26th Dec 2013, 07:01 AM   #8
Warrior Member
 
Join Date: 2013
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default
Re: unlink and unset in PHP
Share on: 
fb share twitter share gplus share more share

Thank you very much shahriyar............

Thanks,
Roger,
connected commerce
rogerlegend is offline  
Unread 26th Dec 2013, 09:46 AM   #9
Bananas are Yellow!
Registered Member
War Room Member
 
David Beroff's Avatar
 
Join Date: 2013
Location: Wyoming, PA, USA
Posts: 1,046
Thanks: 2,549
Thanked 1,600 Times in 928 Posts
Blog Entries: 4
Default
Re: unlink and unset in PHP
Share on: 
fb share twitter share gplus share more share

Originally Posted by Andrew H View Post

People who post questions that clearly have done no research should have their sig link removed. If you posted that question into google instead you would have received an answer much easier... but then you wouldn't get your sig link exposure...
Plus here we have sockpuppets with identical sigs used strictly to double the "conversation".

Put MY voice on YOUR video: AwesomeAmericanAudio.com
David Beroff is offline  
The Following User Says Thank You to David Beroff For This Useful Post:
Unread 27th Dec 2013, 01:29 AM   #10
Warrior Member
 
Join Date: 2013
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default
Re: unlink and unset in PHP
Share on: 
fb share twitter share gplus share more share

hello,

permission denied - unlink()

unlink() is not working for me. any idea?

Thanks,
Roger,
connected commerce
rogerlegend is offline  
Unread 27th Dec 2013, 06:28 AM   #11
Active Warrior
War Room Member
 
Join Date: 2013
Posts: 48
Thanks: 0
Thanked 9 Times in 9 Posts
Default
Re: unlink and unset in PHP
Share on: 
fb share twitter share gplus share more share

Originally Posted by rogerlegend View Post

hello,

permission denied - unlink()

unlink() is not working for me. any idea?
you can only unlink a file that's owned by the process php is running as. if php is run as nobody (apache user) and the file is not owned by nobody youll get a permission denied error also some hosts might disable unlink.
softwarewarden is offline  
Unread 27th Dec 2013, 06:42 AM   #12
IM Rocks!
War Room Member
 
shahriyar's Avatar
 
Join Date: 2010
Location: USA
Posts: 501
Thanks: 52
Thanked 65 Times in 60 Posts
Arrow
Re: unlink and unset in PHP
Share on: 
fb share twitter share gplus share more share

Originally Posted by rogerlegend View Post

hello,

permission denied - unlink()

unlink() is not working for me. any idea?
Checkout these links,
http://forums.phpfreaks.com/topic/17...-on-directory/
http://stackoverflow.com/questions/1...ied-php-unlink

shahriyar is offline  
The Following User Says Thank You to shahriyar For This Useful Post:
Unread 27th Dec 2013, 09:19 AM   #13
digital carpenter
War Room Member
 
brutecky's Avatar
 
Join Date: 2013
Location: Pennsylvania
Posts: 1,306
Thanks: 480
Thanked 747 Times in 444 Posts
Default
Re: unlink and unset in PHP
Share on: 
fb share twitter share gplus share more share

unlink = deletes a file
unset = 'functionally' destroys a varible

brutecky is offline  
Unread 30th Dec 2013, 05:37 AM   #14
Warrior Member
 
Join Date: 2013
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: unlink and unset in PHP
Share on: 
fb share twitter share gplus share more share

hi,

can we delete a folder using unlink()?

Luke Wright,
connected commerce
lukewright is offline  
Unread 30th Dec 2013, 05:48 AM   #15
IM Rocks!
War Room Member
 
shahriyar's Avatar
 
Join Date: 2010
Location: USA
Posts: 501
Thanks: 52
Thanked 65 Times in 60 Posts
Arrow
Re: unlink and unset in PHP
Share on: 
fb share twitter share gplus share more share

Originally Posted by lukewright View Post

hi,

can we delete a folder using unlink()?
No, use rmdir for that.
http://www.php.net/manual/en/function.rmdir.php

shahriyar is offline  
Closed Thread


Bookmarks

Tags
php, unlink, unset


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 11:38 AM.