php - modifying variable in an array and then reinserting it -
hi want take value array, modify , insert new variable in array. kind of imagine looking follows have never worked arrays have no idea.
<?php $foobar = array( "foo" => "foo1", "bar" => "bar1", ) $new_variable = "<img src="$foobar["foo"])">"; $foobar[foo_img] = $new_variable; print_r $foobar; ?>
hope makes sense , thankyou in advance.
there syntax errors in code.
try this
$foobar = array( "foo" => "foo1", "bar" => "bar1" ); $new_variable = "<img src='".$foobar['foo']."'>"; $foobar['foo_img'] = $new_variable; print_r($foobar);
Comments
Post a Comment