Thursday, October 4, 2012

difference between unset and unlink in php



unlink() is used to delete physical files...So lets say you have foo.txt somewhere on your server... unlink(foo.txt) would delete it. unset() is used to null out the value of a given variable. So for instance:

x = 200;

echo(x); // 200

unset(x);

echo(x); // null


The difference between the functions unlink and unset
unlink() is a function for file system handling.
It will simply delete the file in context.

Example for unlink() :

<?php
$fh = fopen('test.html', 'a');
fwrite($fh, '<h1>Hello world!</h1>');
fclose($fh);

unlink('test.html');
?>



unset() is a function for variable management.
It will make a variable undefined.
(or)

Unset () is used to destroy a variable in PHP. In can be used to remove a single variable, multiple variables, or an element from an array. It is phrased as Unset ($remove).
Also Known As: Unset Variable, Destroy Variable

Example for unset() :

<?php
// remove a single variable
unset($a);

// remove a single element in an array
unset($my_array['element']);

// remove multiple variables
unset($a, $b, $c);
?>

Wednesday, October 3, 2012

retrive frineds list from facebook and post wall easlly




1stp-> create app for your website from facebook


2stp->download facebook library class file and put your connection  information

3rd-> call facebook class object and pass for friend list

4rth->get your friends list from facebook
lastly you post wall to your friends wall