sure, you can add/remove/modify element whenever you want

your syntax is wrong though

try this

// add value to array
if($flag == "true"){
    $samplearray[] = $samplevalue;  // append value to end of array
}

-----Original Message-----
From: sundogcurt [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 01, 2002 9:51 AM
To: GENERAL PHP LIST
Subject: [PHP] loading Arrays


Do I have to fully load up an array when I declare it or can I assign 
more values to it later?
What I want to do is something like this :

// create empty array
$samplearray = array();

// add value to array
if($flag == "true"){
    $samplearray => $samplevalue;
}

This doesn't work, can anybody tell me if I'm on the right track here or 
should I scrap it and start over?

Thanks
Curt


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to