php count the number of strings after exploded

前端 未结 5 1072

Here is my code

$key) {
$i >0;
    echo $i.\' \'.$key .         


        
5条回答
  •  梦毁少年i
    2021-01-04 18:46

    If you just need the total number, you could do this:

    $tags = explode('|' , $string);
    $num_tags = count($tags);
    

提交回复
热议问题