Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Regex:find words in text
<?php //word search $pattern = "/sun/i"; //find the word 'sun' $text = "Because the planet is so close to the sun, Mercury's surface temperature can reach a scorching 840 degrees Fahrenheit (450 degrees Celsius)."; $matches = preg_match_all($pattern, $text, $array); echo $matches . " matches were found."; ?>
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
All mondays
user defined function in php to calculate the table
GiniBukan
https://rextester.com/CQEG41074
mmd.php
decompress C# in PHP
PHP regex - modifying HTML element V2
PHP - BinarySearch (How-many-times-sorted-array-rotated)
PHP - pass by reference & a function that accepts an unspecified number of parameters.
Get Max Key in PHP
Please log in to post a comment.