Substring in php Example
Substring: If you want to extract substring from a given string then use the Syntax: substr($string_input,$int_start,$int_length) Example: substr(‘God is love’,7,4); […]
» Read morenext gen Developer
Substring: If you want to extract substring from a given string then use the Syntax: substr($string_input,$int_start,$int_length) Example: substr(‘God is love’,7,4); […]
» Read moreProgram: array_substring.php <?php $rainbow = blUe; print $rainbow[2]; ?> Output: Thanks for reading this post……….!!!
» Read moreThe fwrite() is used to write the contents to text file. Syntax: fwrite($fp,’content’); // content will be written $fp pointer […]
» Read moreSyntax: range($start,$end); Example: range(1,10); Program: range.php <?php $number=range(1,10); print_r($number); ?> Output: Thanks for reading this post…………!!! […]
» Read moreIt is used to convert variables into an array. Syntax: settype($variable_name,’array’); Program: settype.php <?php $variable=25; echo “its variable\t=$variable\n\n”; settype($variable,’array’); […]
» Read moreJoin is used to convert an array variable to string variable. Program: join.php <?php $array5=array(‘mother’,’father’,’brother’,’sister’); echo “printing as array\n”; print_r($array5); […]
» Read moreThe array_map() function iterate through array and send and get back the new value from the user defined function. Syntax: […]
» Read moreThe array_flip() changes key to value and value to key of the given array. Syntax: array_flip($array); Program: array_flip.php <?php $arr_original=array(1=>sunday,2=>monday,3=>tuesday,4=>wednesday,5=>thursday,6=>friday,7=>saturday); […]
» Read moreIt just shuffles the array values not keys. Syntax: Shuffle($array); Program: shuffle.php <?php $name_lucky=array(5,4,6,3); echo “Before shuffle\t\t\n”; print_r($name_lucky); shuffle($name_lucky); // […]
» Read moreIt calculates the product of all the array values. Syntax: array_product($array); Program: <?php $number=array(10,20,5); print_r($number); $total=array_product($number); //array_product() calculates the product […]
» Read more