<!DOCTYPE html>
<html>
<body>

<?php
echo substr_count("I love Shanghai. Shanghai is the biggest city in china.","Shanghai");
?>
  
</body>
</html>