Initially intended to use a foreach history, but found no success, oo not pass, no way oo write ...
After the study decided to use for loop, the demo code is as follows:
Copy CodeThe code is as follows:
$blog =array (
Array
"Titledata" = "Titlemm",
"Bodydata" = "Bodymm"
),
Array
"Titledata" = "Titlegg",
"Bodydata" = "Bodygg"
)
);
Error
foreach ($blog as $b)
{
$b [' Titledata ']= "BB";
$b [' Bodydata ']= "CC";
}
Print_r ($blog);
That's right
for ($i =0; $i
{
$blog [$i] [' Titledata ']= ' title ';
$blog [$i] [' bodydata ']= ' body ';
}
?>
http://www.bkjia.com/PHPjc/323278.html www.bkjia.com true http://www.bkjia.com/PHPjc/323278.html techarticle initially intended to use a foreach history, but found no success, oo do not pass, no way oo write ... after the study decided to use for loop, the demo code is as follows: Copy code code as follows .