PHP substr_count() Function
by TechVidvan Team
Program 1
<html>
<head><title>String in PHP Application</title>
<body>
<pre>
<center>
<?php
//$email="[email protected]";
$mystr="Data flair free course of java script every course is free in Data flair";
// $n=substr_count($mystr,"free",21);
// echo $n;
// $n=substr_count($mystr,"free");
// echo $n;
//echo str_word_count($mystr,1);
// $myarray=str_word_count($mystr,);
// print_r($myarray);
// $count=0;
// for($i=0;$i<strlen($mystr);$i++)
// {
// if($mystr[$i]==' ')
// $count++;
// }
// echo "<br> Total Space is ".$count
// $n=strlen($mystr);
// echo $n;
//strlen()
//str_word_count()
//sub_str_count()
?>
</pre>
</center>
</body>
</html>
Tags: PHPphp practicalphp programphp substr_count() functionphp substring count functionsubstr_count() functionsubstring count function in php
TechVidvan Team
TechVidvan Team provides high-quality content & courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.