select words in variable

Silver-0-surfer

Well-Known Member
Joined
Jan 5, 2008
Messages
317
Reaction score
7
Location
CPT
Hi guys,

I am trying to do something, but It's not going too well, hopefully one of you can help.

Basically what is happening is I am getting plain text sent to me via a specific port, that information is being stored in a variable. I know need to interrogate that variable and get the values from it, hopefully this explains better.

I have a variable $input and its value atm is "It|is|Saturday|night|and|I|am|working"

what I would like to do is store each word maybe in an array or something, I am sure that I can write it to a csv file and then use "|" as the delimiter but I would like to not do that if possible as $inputs value will constantly change and I don't want to run into problems with the wrong values in the wrong textfile being read( working with text files FREAKS me out:) ).

Is it possible to put that information without writing it to a file?

btw I am using PHP.

thanks
 
Top
Sign up to the MyBroadband newsletter
X