How do I get a string out of this array?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ianhull
Forum Contributor
Posts: 310
Joined: Tue Jun 14, 2005 10:04 am
Location: Hull England UK

How do I get a string out of this array?

Post by ianhull »

Hi Guys I have an array called flashString[]

How would I get it formatted like this

Code: Select all

&myString= EACH ARRAY VALUE?
Thanks in advance
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

I'm not sure what you mean.. maybe implode()?
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Post by Jonah Bron »

$myString = implode('', $myString);//implode all parts of array, each value seperated by nothing
ianhull
Forum Contributor
Posts: 310
Joined: Tue Jun 14, 2005 10:04 am
Location: Hull England UK

Post by ianhull »

Hi Jcart, I'm not too sure,

My string looks like this

Code: Select all

&flashString=Judgement Day was defeated by Death RoWs Elite at Gears of War MLG Ladder on 2007-12-16 18:31:12 - ,&flashString=test was defeated by Team Serv at Gears of War MLG Ladder on 2007-12-09 22:28:31 - ,
My array looks like this

Code: Select all

$flashString[0] = 'Judgement Day was defeated by Death RoWs Elite at Gears of War MLG Ladder on 2007-12-16 18:31:12 - ,';

$flashString[1] = '&flashString=test was defeated by Team Serv at Gears of War MLG Ladder on 2007-12-09 22:28:31 - ,';
Just cant get my head around this one
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Can you explain exactly what you are trying to do? Your last post didn't really tell me anything, unfortunately. From what I can tell you've got an array and simply want to output the values? or you are having dificulties parsing the url into an array of values?

Try and explain it in plain English first, then use code examples to highlight the explanation.
ianhull
Forum Contributor
Posts: 310
Joined: Tue Jun 14, 2005 10:04 am
Location: Hull England UK

Post by ianhull »

Thanks,

works a treat :)
Post Reply