replace array value in php in non associative array -


replace array value in php in non associative array,so output $arr = array(1,3,4,5); want replace today 1.

how replace 'today' 1?

$arr = array('today',3,4,5); 

you have write code below

$arr = array('today', 3, 4, 5); foreach ($arr $key => $value) {   if ($value == 'today') {     $arr[$key] = 1;   } } 

thanks


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -