Source: lesson_16_function_substr_count.php | Résultat |
<?php /* substr_count */ $chaine_1 = "waterloo, waterloo, morne plaine"; $chaine_2 = "oo"; $chaine_3 = "ai"; echo "<table cellpadding=3><tr><th>Chaîne_1</th><th>Chaîne_2</th> <th>substr_count()</th></tr><tr>"; echo "<td>$chaine_1</td><td align=center>$chaine_2</td> <td align=center>". substr_count($chaine_1,$chaine_2)."</td></tr><tr>"; echo "<td>$chaine_1</td><td align=center>$chaine_3</td> <td align=center>". substr_count($chaine_1,$chaine_3)."</td></tr><tr>"; echo "</table>";
| Chaîne_1 | Chaîne_2 |
substr_count() |
---|
waterloo, waterloo, morne plaine | oo |
2 | waterloo, waterloo, morne plaine | ai |
1 | |
|