Код: Выделить всё
$firstarray = array("first"=>'pakistan',"second"=>'bangladesh',"third"=>'');
Результат, который я хочу :
Код: Выделить всё
$newfirstarray = array("first"=>'pakistan',"second"=>'bangladesh',"third"=>'No');
Моя маленькая попытка
Код: Выделить всё
$firstarray = array("first"=>'pakistan',"second"=>'bangladesh',"third"=>'');
foreach($firstarray as $keyx){
if($keyx==''){
$keyx='no'; //sorry for this example, at this point i don't know how to put values.
print_r($firstarray );
}
}
Подробнее здесь: https://stackoverflow.com/questions/361 ... array-keys
Мобильная версия