Array substring in php example
Program: array_substring.php <?php $rainbow = blUe; print $rainbow[2]; ?> Output: Thanks for reading this post……….!!!
» Read morenext gen Developer
Program: array_substring.php <?php $rainbow = blUe; print $rainbow[2]; ?> Output: Thanks for reading this post……….!!!
» 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 moreThe array_sum() function calculates the sum value for the given array values. Syntax: array_sum($array); Program: <?php $number=array(10,20,5); print_r($number); $total=array_sum($number); //array_sum() […]
» Read moreArgv is used to get the console array input. But array(0) always contains the name of the script we are […]
» Read more