字串函式庫

substr_count

(PHP4 >= 4.0RC2)

substr_count ---  計算字串的出現次數

語法 : int substr_count (string haystrack, string needle)

說明 : 

substr_count( )傳回參數 needle在 haystrack中出現的次數

Example :

<?php

    print substr_count("This is a test", "is");    // prints out 2

?>


上一頁 首頁 下一頁