php - I am trying to use substr to extract the part of the array element value with a if-else statement -


i new php , having trouble on how output this.

$employee_numbers = array( "sam jerry"=>"1849", "david flint"=>"2274", "lena vincent"=>"2532", robert vanny"=>"3471" ); 

i trying output substr shows name , number.

so looks

sam jerry's employee number is: 1849 --> management

thanks in advanced

you have loop through array.

$employee_numbers = array( "sam jerry"=>"1849", "david flint"=>"2274", "lena vincent"=>"2532", "robert vanny"=>"3471" );  foreach($employee_numbers $employee => $number){    echo $employee . " employee number is: " .$number . php_eol; //don't know management info } 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -