In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> Im trying to take this string, "hello", and explode it into an array
> with each cell in the array containing one character.
> 
> $array[0] = 'h'
> $array[1] = 'e'
> etc..
> 
> How does this work?  When is use...
> 
> $character = explode('', $string) or....
> $character = explode($string)
> 
> ...it doesn't seem to work.  ANY HELP!?!?  THANKS!!
> 

You don't need to do that if you just want to reference a particular 
position in the string. Each character in a string variable can be 
referenced as though the variable is an array of characters. Try:

<?php
$mystring = "hello";
echo $mystring[0]; // outputs h
echo $mystring[4]; outputs o
?>

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to