substr_count function

<?php

$text = '123 456 12 123';
$count = substr_count($text, '123');

echo $count; // 2

Leave a Comment

Your email address will not be published. Required fields are marked *