Jump to content

array = $_POST & foreach


ck1mark

Recommended Posts

[!--quoteo(post=363544:date=Apr 10 2006, 11:19 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Apr 10 2006, 11:19 PM) [snapback]363544[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Is $_POST['arr'] an array or is it a string?

If you put the following line at the beginning of your script, what is displayed?
[code]<?php echo '<pre>' . print_r($_POST,true) . '</pre>'; ?>[/code]

Ken
[/quote]

I dont know how to get a result for that in flash.
I dont think i like php arrays!
I send an array and when i echo $s_arr i get the whole array element1, element2, element3, ..x
if i index it $s_arr[0] i get the first letter.. which in my first post was x

so i assume it is handling my values as a string
Link to comment
https://forums.phpfreaks.com/topic/7086-array-_post-foreach/#findComment-25921
Share on other sites

I don't use Flash, so I don't know how it is sending stuff back.

It looks like you're getting a CSV string returned to your script. To turn it into an array, use the explode() function:
[code]<?php $arr = explode(',',$s_arr); ?>[/code]
Then you can use the array functions.

Arrays in PHP are very powerful.

Ken
Link to comment
https://forums.phpfreaks.com/topic/7086-array-_post-foreach/#findComment-25934
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.