PHP - not returning a count number for filled array...
Posted
by Phil Jackson
on Stack Overflow
See other posts from Stack Overflow
or by Phil Jackson
Published on 2010-04-23T08:41:14Z
Indexed on
2010/04/23
8:43 UTC
Read the original article
Hit count: 326
Morning, this is eating me alive so Im hoping it's not something stupid, lol.
$arrg = array();
if( str_word_count( $str ) > 1 ) {
$input_arr = explode(' ', $str);
die(print_r($input_arr));
$count = count($input_arr);
die($count);
above is part of a function. when i run i get;
> Array (
> [0] => luke
> [1] => snowden
> [2] => create
> [3] => develop
> [4] => web
> [5] => applications
> [6] => sites
> [7] => alse
> [8] => dab
> [9] => hand
> [10] => design
> [11] => love
> [12] => helping
> [13] => business
> [14] => thrive
> [15] => latest
> [16] => industry
> [17] => developer
> [18] => act
> [19] => designs
> [20] => php
> [21] => mysql
> [22] => jquery
> [23] => ajax
> [24] => xhtml
> [25] => css
> [26] => de
> [27] => montfont
> [28] => award
> [29] => advanced
> [30] => programming
> [31] => taught
> [32] => development
> [33] => years
> [34] => experience
> [35] => topic
> [36] => fully
> [37] => qualified
> [38] => electrician
> [39] => city
> [40] => amp
> [41] => guilds
> [42] => level )
Which im expecting;
run this however and nothing is returned!?!?!
$arrg = array();
if( str_word_count( $str ) > 1 ) {
$input_arr = explode(' ', $str);
//die(print_r($input_arr));
$count = count($input_arr);
die($count);
can anyone see anything that my eyes cant??
regards, Phil
© Stack Overflow or respective owner