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
Post a Comment