logo
Blog single photo

Php function array_map()


                        

usefull function in php
<?php
function addtitle($title)
{
    return($title.' Banerjee');
}
$name = array('A', 'B' ,'C' ,'D','F');
$fullname = array_map("addtitle", $name);
foreach($fullname as $fname){
    echo $fname.'</br>';
}
?>

Your output will be look like these

A Banerjee
B Banerjee
C Banerjee
D Banerjee
F Banerjee

Top