• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Basic PHP HELP!!

zimu

Diamond Member
This is driving me nutts!
It seems so simple yet I just can't seem to do it.

Basically, I want to have a form on page 1, lets say form.html, that allows user to put in a comma separated list of numbers. 1,2,3,4 for e.g.-- the input for this is <input type = text name = TheList>

The next page, lets say process.php, i want it so it will take that list of numbers, and make an array out of them, i.e. [1,2,3,4]


I tried doing
$List = array($_POST[TheList]);

but it just doesnt' work. I thought that it would just make the array and voila!

Any help would be appreciated!
Thanks
 
you have to break up your string "1,2,3,4,5" into a bunch of numbers. In perl you'd do "@list = split /,/, $string;

PHP probably looks like what johnnytightlips posted.
 
Back
Top