Run ❯
Get your
own PHP
server
Result Size:
625 x 565
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <?php $str = "Welcome to W3Schools"; $pattern = "/w3schools/i"; preg_match($pattern, $str, $matches, PREG_OFFSET_CAPTURE); print_r($matches); ?> </body> </html>
Array ( [0] => Array ( [0] => W3Schools [1] => 11 ) )