I have a string that divide it into pieces with a comma.
Each piece divide it into smaller interval with.
You have to count how many pieces with interval there are in every piece with comma below.
$string = "1str 1str, 2str 2str, 3str 3str";
$keywords = explode(',', $string);
foreach ($keywords as $v) {
$parts = explode(' ', $v);
echo count($parts) . "<br>";
}
Code (markup):
Where is the problem?
Why counting does not work properly?...
counting strings in foreach
from PHP http://ift.tt/1Ofc1dD
via IFTTT
Out Of Topic Show Konversi KodeHide Konversi Kode Show EmoticonHide Emoticon