We help IT Professionals succeed at work.

want to loop foreach number in a list

rgb192
rgb192 asked
on
196 Views
Last Modified: 2012-05-10
i have a list of numbers 'numbers'
56
46
57
89
76

foreach (numbers as $n){

echo $n;
do something
}
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2018
Distinguished Expert 2019
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Most Valuable Expert 2011
Author of the Year 2014

Commented:
foreach() is a control structure, documented on the PHP web page here.  It operates on arrays and objects, not lists.  Please show us how your list of numbers is organized.
http://us2.php.net/manual/en/control-structures.foreach.php

Author

Commented:
56
46
57
89
76

these are the numbers
I want to copy paste the numbers into the php code

Author

Commented:
yes,  this answered my question

thank you
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.