Jump to content

PHP loop function help needed!


oskare100

Recommended Posts

Hello,

I'm trying to get this code to work:

$item_number="5161516161,784684664864684";

$item_numbers = explode(",", $item_number);
foreach ($item_numbers as &$item_number) {
echo "$item_number";
)

 

I need it to split the 5161516161,784684664864684 and run " echo "$item_number"; " twice, one for each item number.

 

So if $item_number="5161516161,784684664864684,15515151"; then the script is supposed to run " echo "$item_number"; " three times, one time for each item number.

 

Please help, how can I do that? What is wrong with my code/how should it be?

 

/Oskar

Link to comment
https://forums.phpfreaks.com/topic/47273-php-loop-function-help-needed/
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.