Re: string to array
| From: | Andrey Hristov | Date: | Thu, 08 Nov 2001 14:43:09 +0000 |
| Subject: | Re: string to array | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-73877@lists.php.net to get a copy of this message | ||
<?php
$array = explode("", "This is my string");
var_dump($array);
?>
Output :
Warning: Empty delimiter in C:\apache\htdocs\this_is.php on line 6
bool(false)
----- Original Message -----
From: "Jason Brooke" <jason@qgl.org>
To: "pierre-yves" <pylem@sympatico.ca>; <php-general@lists.php.net>
Sent: Thursday, November 08, 2001 4:28 PM
Subject: Re: [PHP] string to array
> Hi Pierre
> A string can already be treated as an array in Php without doing anything to
> it.
>
> For the record though, you probably could've done:
> $array = explode("", "This is my string");
>
> jason
>
> ----- Original Message -----
> From: "pierre-yves" <pylem@sympatico.ca>
> To: <php-general@lists.php.net>
> Sent: Friday, November 09, 2001 12:26 AM
> Subject: [PHP] string to array
>
>
> > Hello,
> >
> > I would like to make an array with a regular string, I cannot use explode
> > because I have no delimiter, how can I do that?
> >
> > ex:
> > This is my string
> > [T][h][i][s][ ][i][s][ ][m][y][ ][s][t][r][i][n][g][\n]
> >
> > py
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>