- var_dump: documentation ( source)
- preg_match: documentation ( source)
<?php
$strings = ['pag=0', '..page=1', 'page=0', 'shmage-page=1', 'test'];
foreach ($strings as $string) {
$matches = [];
if (preg_match('/page=1/', $string, $matches) === 1) {
var_dump($matches);
}
}