Re: [PHP] Count the Number of Elements Using Explode
- From: danbrown@xxxxxxx ("Daniel Brown")
- Date: Fri, 31 Oct 2008 11:32:07 -0500
On Fri, Oct 31, 2008 at 11:29 AM, Alice Wei <ajwei@xxxxxxxxxxxxx> wrote:
Hi,
I have a code snippet here as follows:
$message="1|2|3|4|5";
$stringChunks = explode("|", $message);
Is it possible to find out the number of elements in this string? It seems that I could do things like print_r and find out what is the last element of $stringChunks is, but is there a way where I can use code from the two lines and have it print out 5 as the number of elements that contains after the splitting?
http://php.net/strlen
http://php.net/count
--
</Daniel P. Brown>
http://www.parasane.net/
daniel.brown@xxxxxxxxxxxx || danbrown@xxxxxxx
Ask me about our current hosting/dedicated server deals!
.
- Follow-Ups:
- Re: [PHP] Count the Number of Elements Using Explode
- From: "Diogo Neves"
- Re: [PHP] Count the Number of Elements Using Explode
- Prev by Date: Fwd: [PHP] Count the Number of Elements Using Explode
- Next by Date: Re: [PHP] Mailing lists
- Previous by thread: Re: [PHP] Count the Number of Elements Using Explode
- Next by thread: Re: [PHP] Count the Number of Elements Using Explode
- Index(es):