PHP curse.


i periodically seem run situations seem cursed, ,
code refuses expect, without visible cause. each time has
happened situation has come when reentered
same statement scratch.

i ran particularly bad situation of type evening. had
simple assignment statement feeding 8 text strings array.
when ran program of values in array correct,
returned value '1'. added diagnostic after assignment,
and got same values.

i copied line, changed name of array, , time different set
of values incorrect. tried changing assigned values, adding or
deleting spaces line, same values incorrect,
regardless of contents.

eventually typed out whole assignment statement again, using different
names , values, , time got correct results. typed in
original statement scratch, , time worked correctly.

the following various assignment statements , diagnostics:

$drab = array (0 => 'cybec', 1=> 'cf', 2=> 'ct', 3=> 'flt', 4>= 'wilma',
5=> 'peter', 6>= 'james', 7>= 'joe');

echo '<p>mm_81: ';
$i=0; while ($i <8) { echo $drab[$i++].', '; } echo '</p>';

$rabbit = array
(0=>'joe',1=>'fred',2=>'albert',3=>'tac',4>='ct',5>='cf',6>='ta6',7=>'ub7');

echo '<p>mm_86: ';
$j=0; while ($j <8) { echo $rabbit[$j++].', '; } echo '</p>';

$meat_pie = array (0 => 'steak', 1 => 'lamb', 2 => 'kidney', 3 =>
'tripe',
4 => 'camel', 5 => 'goat', 6 => 'frog', 7 => 'galah');
echo '<p>mm_90: '; $k=0; while ($k<8) { echo $meat_pie[$k++].', '; }
echo '</p>';

$def_r_abb = array (0 => 'cybec', 1 => 'cf', 2 => 'ct', 3 => 'ksf',
4 => 'reft', 5 => 'riordan', 6 => 'user 1', 7 => 'user 2');
echo '<p>mm_94: '; $i=0; while ($i<8) { echo $def_r_abb[$i++].', '; }
echo '</p>';

and these corresponding printouts:

mm_81: cybec, cf, ct, flt, 1, peter, 1, 1,
mm_86: joe, fred, albert, tac, 1, 1, 1, ub7,
mm_90: steak, lamb, kidney, tripe, camel, goat, frog, galah,
mm_94: cybec, cf, ct, ksf, reft, riordan, user 1, user 2,

i have turned on hidden characters , find nothing untoward. can
suggest reason these strange results?

clancy

> $drab = array (0 => 'cybec', 1=> 'cf', 2=> 'ct', 3=> 'flt', 4>= 'wilma',
> 5=> 'peter', 6>= 'james', 7>= 'joe');

let me guess - ones returning value of "1" #4 , #6 , #7?

you don't need way. try line -

$drab = array (0 => 'cybec', 'cf', 'ct', 'flt','wilma', 'peter',
'james','joe');

note in each instance have munged @ least 1 of association
notation, i.e., ">=" rather "=>".

--
murray --- icq 71997575
adobe community expert
(if *must* email me, don't laugh when so!)
==================
http://www.projectseven.com/go - dw faqs, tutorials & resources
http://www.dwfaq.com - dw faqs, tutorials & resources
==================


"clancy" <clancy@cybec.com.au> wrote in message
news:77top3pt1id50prj94n8qfj20juic939rf@4ax.com...
>i periodically seem run situations seem cursed, ,
>the
> code refuses expect, without visible cause. each time
> has
> happened situation has come when reentered
>
> same statement scratch.
>
> ran particularly bad situation of type evening. had
>
> simple assignment statement feeding 8 text strings array.
>
> when ran program of values in array correct,
>
> returned value '1'. added diagnostic after
> assignment,
> , got same values.
>
> copied line, changed name of array, , time
> different set
> of values incorrect. tried changing assigned values, adding or
> deleting spaces line, same values incorrect,
> regardless of contents.
>
> typed out whole assignment statement again, using
> different
> names , values, , time got correct results. typed
> in
> original statement scratch, , time worked correctly.
>
> following various assignment statements , diagnostics:
>
> $drab = array (0 => 'cybec', 1=> 'cf', 2=> 'ct', 3=> 'flt', 4>= 'wilma',
> 5=> 'peter', 6>= 'james', 7>= 'joe');
>
> echo '<p>mm_81: ';
> $i=0; while ($i <8) { echo $drab[$i++].', '; } echo '</p>';
>
> $rabbit = array
> (0=>'joe',1=>'fred',2=>'albert',3=>'tac',4>='ct',5>='cf',6>='ta6',7=>'ub7');
>
> echo '<p>mm_86: ';
> $j=0; while ($j <8) { echo $rabbit[$j++].', '; } echo '</p>';
>
> $meat_pie = array (0 => 'steak', 1 => 'lamb', 2 => 'kidney', 3 =>
> 'tripe',
> 4 => 'camel', 5 => 'goat', 6 => 'frog', 7 => 'galah');
> echo '<p>mm_90: '; $k=0; while ($k<8) { echo $meat_pie[$k++].', '; }
> echo '</p>';
>
> $def_r_abb = array (0 => 'cybec', 1 => 'cf', 2 => 'ct', 3 => 'ksf',
> 4 => 'reft', 5 => 'riordan', 6 => 'user 1', 7 => 'user 2');
> echo '<p>mm_94: '; $i=0; while ($i<8) { echo $def_r_abb[$i++].', '; }
> echo '</p>';
>
> , these corresponding printouts:
>
> mm_81: cybec, cf, ct, flt, 1, peter, 1, 1,
> mm_86: joe, fred, albert, tac, 1, 1, 1, ub7,
> mm_90: steak, lamb, kidney, tripe, camel, goat, frog, galah,
> mm_94: cybec, cf, ct, ksf, reft, riordan, user 1, user 2,
>
> have turned on hidden characters , find nothing untoward. can
>
> suggest reason these strange results?
>
> clancy



More discussions in Dreamweaver support forum


adobe

Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support