Re: [PHP] Re: Simple Array question (conclusion)

2003-07-29 Thread John W. Holmes
Ryan A wrote:

I GOT IT

this is where the data was coming from:
 input name=id[sh123] type=hidden id=id[sh123] value=32
  input name=id[sh1sd] type=hidden id=id[sh1sd] value=563
and this is where i take the values and dump it into an array/variables that
i can call when and where i please:
?php
$nn=0;
foreach($id as $nname = $pppno)
{$asdf[$nn]=$pppno;
 $nn++;  }
?
brbr?php echo $asdf[0]; ?br
?php echo $asdf[1]; ?
I just took out some of the breaks so it will take less space but you get
the idea.
Thank you to everyone who tried to help, but maybe i didnt explain the
problem well enough that you didnt get the answer or just didnt want to :-D
Seriously?

You could just replace the above with:

$asdf = array_values($_POST['id']);

I think you need to be cut off from the list for a while. Trial by fire, 
I say!!

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





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


[PHP] John-Re: [PHP] Re: Simple Array question (conclusion)

2003-07-29 Thread Ryan A
Hey John,
I guess you are right, I do rely on this list quite a bit but am not the
only one.
Am learning by my mistakes though and finding solutions...they may not be
the best solutions but they still work, everyone has to learn.
Thanks for replying to the question though. And i didnt know about the
array_values thingsee? the more you reply to me the more i learn :-D
Cheers,
-Ryan



 Ryan A wrote:

  I GOT IT
 
  this is where the data was coming from:
   input name=id[sh123] type=hidden id=id[sh123] value=32
input name=id[sh1sd] type=hidden id=id[sh1sd] value=563
 
  and this is where i take the values and dump it into an array/variables
that
  i can call when and where i please:
 
  ?php
  $nn=0;
  foreach($id as $nname = $pppno)
  {$asdf[$nn]=$pppno;
   $nn++;  }
  ?
  brbr?php echo $asdf[0]; ?br
  ?php echo $asdf[1]; ?
 
 
  I just took out some of the breaks so it will take less space but you
get
  the idea.
 
  Thank you to everyone who tried to help, but maybe i didnt explain the
  problem well enough that you didnt get the answer or just didnt want to
:-D

 Seriously?

 You could just replace the above with:

 $asdf = array_values($_POST['id']);

 I think you need to be cut off from the list for a while. Trial by fire,
 I say!!

 --
 ---John Holmes...

 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

 PHP|Architect: A magazine for PHP Professionals  www.phparch.com






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