Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a list of numbers

Status
Not open for further replies.

stacybk

Programmer
Joined
Oct 22, 2003
Messages
15
Location
US
I have a comma separated list of numbers that I need to add additional numbers to. First, I want to check if the number is there before I add it. Is there a function that does this? Like in MySQL I would say "number IN thelist".

Thanks.
 
why not form an array and use in_array() ?
else seperate the numbers on comma (use explode()), use for loop, check if the number exists in the loop and if no appened at the end of it..


--------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top