Search Help Board

PHP Articles
PHP Help
Bulletin Board

PHP Manual (NEW!)
First Time PHP'ers
Help with programming
Sql assignment help
PHP Homework Help

C# Help

?Re: accessing array using address variables
Date:???10-24-03 22:28

for ($i=0;$i<3;$i++){
$ins1="int" . $i;
$ins2 = $ins1;
// notice the double dollar ($$)

this is easier than explaining


echo $$var_name; // returns 21
echo ${"ag" . "e"}; // the same as above

but for this case its better like this:

$months = array(null, "Jan", "Feb", ..., "Dec");
// january is not month zero!

echo $months[5]; // returns "May"

or even easier:

echo date("F", mktime(0, 0, 0, 12, 0, 0)); // returns "December"

see php.net

?Topics Author? Date
?accessing array using address variables??new
jan 10-14-03 21:26?
?Re: accessing array using address variables??new
federico 10-24-03 22:28?
Go to Top??|??Go to Topic??|??Flat View??|??Search?
New Topic
?Reply To This Message
?Your Name:
?Your Email:
Email replies to this thread, to the address above.

Provided By