Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2001092

[PHP] Re: Warning: unexpected regex error (14) From: CC Zona (cczona <email protected>)
Date: 09/30/01

In article <20010930141539.81124.qmail <email protected>>,
 big5ive <email protected> (Big5ive) wrote:

> $list = split("|",$user, 3);
> echo "<tr
> align=left><td>$list[0]</td><td>$list[1]</td><td>$list[2]</td></tr>";
> ?>
> </table>
> </body>
> </html>
>
> How can i fix this error?
> Content of members.txt is
> Big5ive|Admin|24.09.2001
>
> The script should read the text file and split the content by | and write it
> in a table.

Split is a regex function, and "|" is a regex special character meaning
"or" when it's not escaped. You don't have need for regex matching here, so
just use explode() instead:

explode("|",$user, 3);

-- 
CC

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>