Jump to content

PHP Arrays


Eugene

Recommended Posts

Hmm... is $somevar set? Your second attempt should be right, but I have to wonder if you may be missing the semicolon in the line above it, though:
[code]
<?php
// Either of these should work:
$somearray = array('one' => $somevar);
$somearray = array('one' => "$somevar");
?>
[/code]

Notice that with [b]double quotes[/b], your variable will be interpreted. Single quotes return the literal characters contained within them.
Link to comment
https://forums.phpfreaks.com/topic/31959-php-arrays/#findComment-148291
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.