Created
June 23, 2016 19:16
-
-
Save talha08/83ebcd2288ea29efca088e759c40b589 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <body> | |
| <?php | |
| $string = "A dowry deaths is a murder or suicide of a married woman caused by a dispute over her dowry.[4] In some cases, husbands and in-laws will attempt to extort a greater dowry through continuous harassment and torture which sometimes results in the wife committing suicide"; | |
| $words = array("women", "murder","rape","female","dowry"); | |
| $sum = 0; | |
| foreach($words as $word) { | |
| // $word." occurance are ".substr_count($string, $word)." times <br />"; | |
| $total = substr_count($string, $word); | |
| $sum = $sum + $total; | |
| } | |
| echo $sum; | |
| ?> | |
| </body> | |
| </html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment