Actually, you can treat a string as an array without any further processing:
$Globbot = 'dribcot';
echo $Globbot[0]; # echoes 'd'
echo $Globbot[6]; # echoes 't'
Check out 'String access by character' about halfway down the page at
http://www.php.net/manual/en/language.types.string.php
(or, in Portuguese,
http://www.php.net/manual/pt_BR/language.types.string.php
).
Actually, using the [] syntax is deprecated - using {} is the new way
- but I'm a creature of habit...
-steve
At 11:57 AM +0100 1/17/02, Nick Wilson <[EMAIL PROTECTED]> wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>
>* On 17-01-02 at 11:46
>* Sandeep Murphy said....
>
>> hi,
>>
>> can i convert a string to an array?? if so how shud the syntax read??
>>
>> Thnx,
>>
>> sands
>>
>
>Check out explode()
>www.php.net/manual/en/function.explode.php
>
>- --
>
>Nick Wilson
>
>Tel: +45 3325 0688
>Fax: +45 3325 0677
>Web: www.explodingnet.com
>
--
+------------------------------------------------------------------------+
| Steve Edberg [EMAIL PROTECTED] |
| University of California, Davis (530)754-9127 |
| Programming/Database/SysAdmin http://pgfsun.ucdavis.edu/ |
+------------------------------------------------------------------------+
| "Restriction of free thought and free speech is the most dangerous of |
| all subversions. It is the one un-American act that could most easily |
| defeat us." |
| - Supreme Court Justice (1939-1975) William O. Douglas |
+------------------------------------------------------------------------+
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]