Thursday, 5 September 2013

Using PHP to split a string

Using PHP to split a string

How to split a string using php and store into three different array ? I'm
quite new to php so please give me a detail answer if you can~
Input would be a string we don't know how long it is:
ubuntu1204gui Client myurl/token=something1 windows7 Gateway
myurl/token=token=something2 ubuntu1204gui Server
myurl/token=token=something3 ...
and out put should be three array:
array1[0]= ubuntu1204gui
array1[1]= windows7
array1[2]= ubuntu1204gui
array1[3]= ...
...
array2[0]= Client
array2[1]= Gateway
array2[2]= Server
array2[3]= ...
...
array3[0]=myurl/token=token=something1
array3[1]=myurl/token=token=something2
array3[2]=myurl/token=token=something3
array3[3]=...
...
Thanks a lot for your help!

No comments:

Post a Comment