Php is a popular language to make web application . I am going to discuss 10 functions a php Lerner should know . If you are a php developer these function will help you at every step .
1) Rand(): rand() function is used to get random no between two numbers . function can accept two optional parameter min (default is 0)and max (default is getrandmax()). uses are

$randomno=rand();   // return a no between 0 to largest no that can be returned by rand();
//or
$random=rand(100,999999); // return a no between 100 and 999999

2) array_rand(): array_rand() method is used to get random one or more entries from an array . uses

<?php
$array = array("codingbin.com", "codingscripts.com", "programmingscripts.com", "whatsappfresh.com", "blog2knowledge.com");
$rand_keys = array_rand($input, 2);
echo $array[$rand_keys[0]] . "\n";
echo $array[$rand_keys[1]] . "\n";
?>

3) isset(): isset() method is used to check weather a variable is set or not .if a variable exists it’ll return true else false . This is one of the most common used php function . Uses are

isset($_POST['myname']);
$myname='manoj dhiman';
isset($myname); // return true
isset($mylastname); //return false

4) range(): range() method is used to get an array with numbers or letters between two numbers/letters.Method have three parameters .
a) low:required parameter . specify the lowest value
b) high:required parameter . specify the highest value
c) step : optional parameter .Specifies the increment used in the range. Default is 1

Uses are

range(10,50);  //return array(10,11,12,13..................50); 
range('a','z'); // return array('a','b','c','d'..............'z');
$number = range(0,50,10); //return Array ( [0] => 0 [1] => 10 [2] => 20 [3] => 30 [4] => 40 [5] => 50 )

5) strip_tags() strip_tags() method is used to Get rid of HTML tags in paragraph. mostly used in the cms . This function accept 1 required and 1 optional parameter
a) string :required. the string with html tag
b) allowed tags: optional . if you want to specify tags which should not be stripped .
uses

$text = '<p>Welcome to codingBin.</p><!-- Comment --> <a href="www.codingbin.com">website link</a>';
echo strip_tags($text);   // output Welcome to codingBin. website link
echo strip_tags($text,'<p><a>'); //<p>Welcome to codingBin.</p><a href="www.codingbin.com">website link</a>

6) file_get_contents():file_get_contents() functions is used to get the content of a file . Method has parameters.
a) filename: name of the file you want to get.
b) use_include_path: the include path .As of PHP 5 the FILE_USE_INCLUDE_PATH constant can be used to trigger include path search.
c) context: A valid context resource created with stream_context_create().you can use null .
d) offset:The point where the reading starts on the original stream.
e) maxlen: max length of data read

$homepage = file_get_contents('http://www.codingbin.com/');
echo $homepage;
// <= PHP 5
$file = file_get_contents('codingbin.txt', true);
// > PHP 5
$file = file_get_contents('codingbin.txt', FILE_USE_INCLUDE_PATH);
// Read 20 characters starting from the 11th character
$section = file_get_contents('./people.txt', NULL, NULL, 10, 20);

7) move_uploaded_file(): move_uploaded_file() method is one of the most common used php function used . The method is used to upload a file from local computer to server . function needs two required parameters .
a) filename: the file name from local computer
b) destinationfile: destination file name on the server .
function will return true on successful upload and false on any error. Uses are

$uploads_dir = '/uploads';
foreach ($_FILES["pictures"]["error"] as $key => $error) {
    if ($error == UPLOAD_ERR_OK) {
        $tmp_name = $_FILES["pictures"]["tmp_name"][$key];
        $name = $_FILES["pictures"]["name"][$key];
        move_uploaded_file($tmp_name, "$uploads_dir/$name");
    }
}

8) Glob(): Many PHP functions have long and descriptive names. However it may be hard to tell what a function named glob() does unless you are already familiar with that term from elsewhere.You can use this function like scandir(). here is an example

// get all textfiles
$files = glob('*.txt');
print_r($files);
/* output looks like:
Array
(
    [0] => check.txt
    [1] => mydetail.txt
)
*/

9)uniqid():uniqid() method is used to get a unique string with combinations of letters and numbers .the method can be used to generate guids. uses are

echo uniqid();
// print 6ae49d947233e
// with prefix
echo uniqid('foo_');
/* prints
foo_4bd67d6cd8b8f
*/

10) serialize(): serialize() function is used to get a serialize string of an array . the function can be used to store a complex variable like array into database . you can use unserialize() to get the original value

<?php
// a complex array
$myinput = array('manoj','codingbin',array(20,'this is a text'),20);
 
// convert to a string
echo $string = serialize($myinput);
// output a:4:{i:0;s:5:"manoj";i:1;s:9:"codingbin";i:2;a:2:{i:0;i:20;i:1;s:14:"this is a text";}i:3;i:20;}
// you can reproduce the original variable
$newvar = unserialize($string);
 
print_r($newvar);
Array ( [0] => manoj [1] => codingbin [2] => Array ( [0] => 20 [1] => this is a text ) [3] => 20 )
?>
http://codingbin.com/wp-content/uploads/2015/12/Untitled-1-copy4.jpghttp://codingbin.com/wp-content/uploads/2015/12/Untitled-1-copy4-150x150.jpgdevidphpphp,php functionsPhp is a popular language to make web application . I am going to discuss 10 functions a php Lerner should know . If you are a php developer these function will help you at every step . 1) Rand(): rand() function is used to get random no between...coding, php, wordpress, yii, cakephp, and  jquery

Are you want to get implementation help, or modify or extend the functionality of this script? Submit paid service request