question here…
I have a variable called number that could equal any of these or more… The length of the file can not be determined
[code=php]$number = 1000 – 2000 – 3000 – 4000 – 5000 – 6000 – 7000 – 8000 –
$number = 5000 – 6000 – 7000 – 8000 –
$number = 4500
$number = 3
What I am trying to do with this next is SPLIT the variable so that I can use it in a select statement as such:
[code=php]
$query =”SELECT * FROM quicklinks WHERE Link_Num = ‘$number'”;
I need the string to split so that the numbers are such are just the numbers with no – inbetween or spaces. Then I want to run all numbers through my query one at a time. So that it would be like this:
[code=php]
$query =”SELECT * FROM quicklinks WHERE Link_Num = ‘$number'”;
do this…..
repeat with next number..
Would the best way to do this be to turn the variable in to an ARRAY and then do a foreach loop? if so.. What is the best way to write this?