Jump to content

[SOLVED] quick question. Using IF


paulman888888

Recommended Posts

another option

$string = 'Hello world';
$X = $string[0]; 
echo $X;//return H

however i use substr() myself

$string = 'Hello world';
$X = substr($string,0,1);
echo $X;//return H

 

EDIT: updated to set $X as the first letter (in case it helps)

Thanks guys!

 

Also i never new that you could access a string useing array like functions! I dont think i said that in a cleaver way.

 

Want i meant to say was; i never new you could use $string='something'; and access as $string[number];

 

Great help! Thanks

Paul

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.