I have looked for some responses on the web, but none of them are very accurate.
I want to be able to do this:
$id = \"\" . $result [\"id\"] . \"\"; $i
Yes, you can store variables within arrays, though you'll need to remove the space between $result and the opening bracket.
$result
$foo = $result["bar"]; // assuming value of 'bar' $collection = array( $foo, "fizz" ); foreach ( $collection as $item ) { // bar, fizz echo $item; }