Re: Count the Number of Elements Using Explode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Diogo Neves wrote:
Hi Alice,

U can simple do:
$nr = ( strlen( $message ) / 2 ) + 1 );
$nr = count( explode( '|', $message );

Or...

$num = (substr_count($message, "|") + 1);

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux