Clearing up the Explode function

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
User avatar
a94060
Forum Regular
Posts: 543
Joined: Fri Feb 10, 2006 4:53 pm

Clearing up the Explode function

Post by a94060 »

Hi,i just wanted to clear up the explode function.

In this code ex.

Code: Select all

$admins= "feyd:jcart:d11person";
$table=explode(":",$admins);
echo 'The best mod is ".$table[0]"';//this should give out feyd as the var?
thats pretty much right,right?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Clearing up the Explode function

Post by Chris Corbyn »

a94060 wrote:Hi,i just wanted to clear up the explode function.

In this code ex.

Code: Select all

$admins= "feyd:jcart:d11person";
$table=explode(":",$admins);
echo 'The best mod is ".$table[0]"';//this should give out feyd as the var?
thats pretty much right,right?
Well yes, your logic is right, but your use of single quotes isn't, although I expect that's a typo ;)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

brown nosing it gets you nowhere. :P
User avatar
a94060
Forum Regular
Posts: 543
Joined: Fri Feb 10, 2006 4:53 pm

Re: Clearing up the Explode function

Post by a94060 »

d11wtq wrote:
a94060 wrote:Hi,i just wanted to clear up the explode function.

In this code ex.

Code: Select all

$admins= "feyd:jcart:d11person";
$table=explode(":",$admins);
echo "The best mod is '.$table[0]'";//this should give out feyd as the var?
thats pretty much right,right?
Well yes, your logic is right, but your use of single quotes isn't, although I expect that's a typo ;)
i changed it,just check it for me please? i also dont imply that feyd is just the best mod,you all are good :lol:
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

Check what? Your quotes are still fubar'd
User avatar
a94060
Forum Regular
Posts: 543
Joined: Fri Feb 10, 2006 4:53 pm

Post by a94060 »

i still dont get what you mean,:( can you show me? i still remeber when i asked my first problem,i did not understand th equote problem :cry:
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Code: Select all

echo "The best mod is $table[0]";
or my preference

Code: Select all

echo 'The best mod is '.$table[0];
and read http://ca3.php.net/manual/en/language.t ... tax.single
Post Reply