If someone can help with this please examine the following problem...

$lefta = array();
$leftid = array();
$top = count($connarray); //connarray is an array of lines from a file with
repeating sections that have values in the form value=setting
for ($i=0;$i<$top;$i++)
        if (preg_match("/\bleft\b/", connarray[$i]))
                array_push($lefta, "$connarray[$i]");
        if (preg_match("/\bleftid\b/", connarray[$i]))
                array_push($leftida, "$connarray[$i]");


In later sequences I remove everything up to and including the "=" sign
which leaves the "setting" under a different array.  However, $lefta is not
modified itself.  After a number of cycles I found a problem.  In some cases
there is a leftid= that has a name, yet in that section there is no left=.
When this form displays the data using a for loop and populating the
variables with the $lefta and $leftida I found that when there is no left=
nothing gets added to the array.  How can I force an addition to the array
when the value is not found?  Also, this is over-simplified.  I'm only
showing two values out of the actual search having 15 possible and the
number of loops can be 5 sections (more or less) with less than or 15 lines

I've been swimming around in this code for a while and I'm new to this stuff
so my apologies if I my description is hard to follow.

Larry S. Brown
Dimension Networks, Inc.
Member ICCA
(727) 723-8388

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to