Re: [PHP] Count the Number of Elements Using Explode
- From: matt@xxxxxxxxxxxxxxxx (Matthew Powell)
- Date: Fri, 31 Oct 2008 12:17:11 -0500
Diogo Neves wrote:
Hi Alice,
U can simple do:
$nr = ( strlen( $message ) / 2 ) + 1 );
$nr = count( explode( '|', $message );
Or...
$num = (substr_count($message, "|") + 1);
.
- References:
- Re: [PHP] Count the Number of Elements Using Explode
- From: "Daniel Brown"
- Re: [PHP] Count the Number of Elements Using Explode
- From: "Diogo Neves"
- Re: [PHP] Count the Number of Elements Using Explode
- Prev by Date: Re: [PHP] Reg Ex
- Next by Date: Re: [PHP] Sessions in object oriented code
- Previous by thread: Re: [PHP] Count the Number of Elements Using Explode
- Index(es):