8,35d7 < function ourexplode($needle, $haystack) { < $isordinal=false; < $intrm=explode($needle, $haystack)[0]; < if ($intrm != $haystack) { < if (strlen($intrm) >= 4) { < if (substr($intrm,-4,1) >= '0' && substr($intrm,-4,1) <= '9') { < if (substr($intrm,-1,1) == ' ') { < switch (strtolower(substr($intrm,-3,2))) { < case 'st': < case 'nd': < case 'rd': < case 'th': < $isordinal=true; < break; < < default: < break; < } < } < } < } < } < if ($isordinal) { < return str_replace(substr($intrm,-3,3), ' ', str_replace(substr($intrm,-3,3) . $needle . ',', substr($intrm,-3,3) . $needle . ' ', $haystack)); < } < return $haystack; < } < 38d9 < $previa=''; 40d10 < $befvia=''; 46,262d15 < if (strpos(strtolower(' ' . $viapm . ' '), 'january') !== false) { < $viapm=str_replace('January','01', str_replace('january','01', str_replace('JANUARY','01', $viapm))); < $viapm=ourexplode('01', $viapm); < if (substr($viapm,0,2) == '01') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), 'jan ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jan/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jan-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jan,') !== false) { < $viapm=str_replace('Jan','01', str_replace('jan','01', str_replace('JAN','01', $viapm))); < $viapm=ourexplode('01', $viapm); < if (substr($viapm,0,2) == '01') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), 'february') !== false) { < $viapm=str_replace('February','02', str_replace('february','02', str_replace('FEBRUARY','02', $viapm))); < $viapm=ourexplode('02', $viapm); < if (substr($viapm,0,2) == '02') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), 'feb ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'feb/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'feb-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'feb,') !== false) { < $viapm=str_replace('Feb','02', str_replace('feb','02', str_replace('FEB','02', $viapm))); < $viapm=ourexplode('02', $viapm); < if (substr($viapm,0,2) == '02') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), 'march') !== false) { < $viapm=str_replace('March','03', str_replace('march','03', str_replace('MARCH','03', $viapm))); < $viapm=ourexplode('03', $viapm); < if (substr($viapm,0,2) == '03') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), ' mar ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'mar/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'mar-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'mar,') !== false) { < $viapm=str_replace('Mar','03', str_replace('mar','03', str_replace('MAR','03', $viapm))); < $viapm=ourexplode('03', $viapm); < if (substr($viapm,0,2) == '03') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), 'april') !== false) { < $viapm=str_replace('April','04', str_replace('april','04', str_replace('APRIL','04', $viapm))); < $viapm=ourexplode('04', $viapm); < if (substr($viapm,0,2) == '04') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), ' apr ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'apr/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'apr-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'apr,') !== false) { < $viapm=str_replace('Apr','04', str_replace('apr','04', str_replace('APR','04', $viapm))); < $viapm=ourexplode('04', $viapm); < if (substr($viapm,0,2) == '04') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), 'may') !== false) { < $viapm=str_replace('May','05', str_replace('may','05', str_replace('MAY','05', $viapm))); < $viapm=ourexplode('05', $viapm); < if (substr($viapm,0,2) == '05') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), ' may ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'may/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'may-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'may,') !== false) { < $viapm=str_replace('May','05', str_replace('may','05', str_replace('MAY','05', $viapm))); < $viapm=ourexplode('05', $viapm); < if (substr($viapm,0,2) == '05') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), 'june') !== false) { < $viapm=str_replace('June','06', str_replace('june','06', str_replace('JUNE','06', $viapm))); < $viapm=ourexplode('06', $viapm); < if (substr($viapm,0,2) == '06') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), ' jun ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jun/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jun-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jun,') !== false) { < $viapm=str_replace('Jun','06', str_replace('jun','06', str_replace('JUN','06', $viapm))); < $viapm=ourexplode('06', $viapm); < if (substr($viapm,0,2) == '06') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), 'july') !== false) { < $viapm=str_replace('July','07', str_replace('july','07', str_replace('JULY','07', $viapm))); < $viapm=ourexplode('07', $viapm); < if (substr($viapm,0,2) == '07') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), ' jul ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jul/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jul-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'jul,') !== false) { < $viapm=str_replace('Jul','07', str_replace('jul','07', str_replace('JUL','07', $viapm))); < $viapm=ourexplode('07', $viapm); < if (substr($viapm,0,2) == '07') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), 'august') !== false) { < $viapm=str_replace('August','08', str_replace('august','08', str_replace('AUGUST','08', $viapm))); < $viapm=ourexplode('08', $viapm); < if (substr($viapm,0,2) == '08') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), ' aug ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'aug/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'aug-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'aug,') !== false) { < $viapm=str_replace('Aug','08', str_replace('aug','08', str_replace('AUG','08', $viapm))); < $viapm=ourexplode('08', $viapm); < if (substr($viapm,0,2) == '08') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), 'september') !== false) { < $viapm=str_replace('September','09', str_replace('september','09', str_replace('SEPTEMBER','09', $viapm))); < $viapm=ourexplode('09', $viapm); < if (substr($viapm,0,2) == '09') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), ' sep ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'sep/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'sep-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'sep,') !== false) { < $viapm=str_replace('Sep','09', str_replace('sep','09', str_replace('SEP','09', $viapm))); < $viapm=ourexplode('09', $viapm); < if (substr($viapm,0,2) == '09') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), 'october') !== false) { < $viapm=str_replace('October','10', str_replace('october','10', str_replace('OCTOBER','10', $viapm))); < $viapm=ourexplode('10', $viapm); < if (substr($viapm,0,2) == '10') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), ' oct ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'oct/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'oct-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'oct,') !== false) { < $viapm=str_replace('Oct','10', str_replace('oct','10', str_replace('OCT','10', $viapm))); < $viapm=ourexplode('10', $viapm); < if (substr($viapm,0,2) == '10') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), 'november') !== false) { < $viapm=str_replace('November','11', str_replace('november','11', str_replace('NOVEMBER','11', $viapm))); < $viapm=ourexplode('11', $viapm); < if (substr($viapm,0,2) == '11') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), ' nov ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'nov/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'nov-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'nov,') !== false) { < $viapm=str_replace('Nov','11', str_replace('nov','11', str_replace('NOV','11', $viapm))); < $viapm=ourexplode('11', $viapm); < if (substr($viapm,0,2) == '11') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), 'december') !== false) { < $viapm=str_replace('December','12', str_replace('december','12', str_replace('DECEMBER','12', $viapm))); < $viapm=ourexplode('12', $viapm); < if (substr($viapm,0,2) == '12') { $previa="\\(([0-9]{4})"; } < } else if (strpos(strtolower(' ' . $viapm . ' '), ' dec ') !== false || strpos(strtolower(' ' . $viapm . ' '), 'dec/') !== false || strpos(strtolower(' ' . $viapm . ' '), 'dec-') !== false || strpos(strtolower(' ' . $viapm . ' '), 'dec,') !== false) { < $viapm=str_replace('Dec','12', str_replace('dec','12', str_replace('DEC','12', $viapm))); < $viapm=ourexplode('12', $viapm); < if (substr($viapm,0,2) == '12') { $previa="([0-9]{4})"; } < } < < if (preg_match('/([0-9]{4})/i', $viapm)) { < if (!preg_match('/\(([0-9]{4})/i', $viapm)) { < if (preg_match('/^([0-9]{4})/i', $viapm)) { < $previa="\\("; < } < } < if (preg_match('/([0-9]{1})\/([0-9]{2})\/([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\/([0-9]{1})\/([0-9]{4})/i', $viapm)) { < $dnums=explode('/', $viapm); < $dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))]; < $dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))]; < $dnums[2]=explode(' ', $dnums[2])[0]; < $dnums[2]=explode(',', $dnums[2])[0]; < if (substr(('0' . $dnums[1]),-2,2) > '12') { < $viapm=str_replace($dnums[0] . '/' . $dnums[1] . '/' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm); < } else { < $viapm=str_replace($dnums[0] . '/' . $dnums[1] . '/' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm); < } < } else if (preg_match('/([0-9]{1})\-([0-9]{2})\-([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\-([0-9]{1})\-([0-9]{4})/i', $viapm)) { < $dnums=explode('-', $viapm); < $dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))]; < $dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))]; < $dnums[2]=explode(' ', $dnums[2])[0]; < $dnums[2]=explode(',', $dnums[2])[0]; < if (substr(('0' . $dnums[1]),-2,2) > '12') { < $viapm=str_replace($dnums[0] . '-' . $dnums[1] . '-' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm); < } else { < $viapm=str_replace($dnums[0] . '-' . $dnums[1] . '-' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm); < } < } else if (preg_match('/([0-9]{1})\ ([0-9]{2})\ ([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\ ([0-9]{1})\ ([0-9]{4})/i', $viapm)) { < $thiszero=-1; < for ($ik=0; $ik= '0' && substr(substr($viapm, $ik),0,1) <= '9') { < $thiszero=$ik; < } < } < } < $dnums=explode(' ', substr($viapm, max($thiszero,0))); < $dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))]; < $dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))]; < $dnums[2]=explode(' ', $dnums[2])[0]; < $dnums[2]=explode(',', $dnums[2])[0]; < if (substr(('0' . $dnums[1]),-2,2) > '12') { < $viapm=str_replace($dnums[0] . ' ' . $dnums[1] . ' ' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm); < } else { < $viapm=str_replace($dnums[0] . ' ' . $dnums[1] . ' ' . substr($dnums[2],0,4), substr($dnums[2],0,4) . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm); < } < } else if (preg_match('/([0-9]{2})\/([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\/([0-9]{4})/i', $viapm)) { < $dnums=explode('/', $viapm); < $dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))]; < $dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))]; < $dnums[1]=explode(' ', $dnums[1])[0]; < $dnums[1]=explode(',', $dnums[1])[0]; < $viapm=str_replace($dnums[0] . '/' . substr($dnums[1],0,4), substr($dnums[1],0,4) . substr(('0' . $dnums[0]),-2,2), $viapm); < } else if (preg_match('/([0-9]{2})\-([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\-([0-9]{4})/i', $viapm)) { < $dnums=explode('-', $viapm); < $dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))]; < $dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))]; < $dnums[1]=explode(' ', $dnums[1])[0]; < $dnums[1]=explode(',', $dnums[1])[0]; < $viapm=str_replace($dnums[0] . '-' . substr($dnums[1],0,4), substr($dnums[1],0,4) . substr(('0' . $dnums[0]),-2,2), $viapm); < } else if (preg_match('/([0-9]{2})\ ([0-9]{4})/i', $viapm) || preg_match('/([0-9]{1})\ ([0-9]{4})/i', $viapm)) { < $thiszero=-1; < for ($ik=0; $ik= '0' && substr(substr($viapm, $ik),0,1) <= '9') { < $thiszero=$ik; < } < } < } < $dnums=explode(' ', substr($viapm, max($thiszero,0))); < $dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))]; < $dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))]; < $dnums[1]=explode(' ', $dnums[1])[0]; < $dnums[1]=explode(',', $dnums[1])[0]; < $viapm=str_replace($dnums[0] . ' ' . substr($dnums[1],0,4), substr($dnums[1],0,4) . substr(('0' . $dnums[0]),-2,2), $viapm); < } < } else if (preg_match('/([0-9]{1})\/([0-9]{1})/i', $viapm)) { < $dnums=explode('/', $viapm); < $dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))]; < $dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))]; < $dnums[1]=explode(' ', $dnums[1])[0]; < $dnums[1]=explode(',', $dnums[1])[0]; < if (substr(('0' . $dnums[0]),-2,2) > '12') { < $viapm=str_replace($dnums[0] . '/' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm); < } else { < $viapm=str_replace($dnums[0] . '/' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm); < } < } else if (preg_match('/([0-9]{1})\-([0-9]{1})/i', $viapm)) { < $dnums=explode('-', $viapm); < $dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))]; < $dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))]; < $dnums[1]=explode(' ', $dnums[1])[0]; < $dnums[1]=explode(',', $dnums[1])[0]; < if (substr(('0' . $dnums[0]),-2,2) > '12') { < $viapm=str_replace($dnums[0] . '-' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm); < } else { < $viapm=str_replace($dnums[0] . '-' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm); < } < } else if (preg_match('/([0-9]{1})\ ([0-9]{1})/i', $viapm)) { < $thiszero=-1; < for ($ik=0; $ik= '0' && substr(substr($viapm, $ik),0,1) <= '9') { < $thiszero=$ik; < } < } < } < $dnums=explode(' ', substr($viapm, max($thiszero,0))); < $dnums[0]=explode(',', $dnums[0])[-1 + sizeof(explode(',', $dnums[0]))]; < $dnums[0]=explode(' ', $dnums[0])[-1 + sizeof(explode(' ', $dnums[0]))]; < $dnums[1]=explode(' ', $dnums[1])[0]; < $dnums[1]=explode(',', $dnums[1])[0]; < if (substr(('0' . $dnums[0]),-2,2) > '12') { < $viapm=str_replace($dnums[0] . ' ' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[1]),-2,2) . substr(('0' . $dnums[0]),-2,2), $viapm); < } else { < $viapm=str_replace($dnums[0] . ' ' . $dnums[1], '([0-9]{4})' . substr(('0' . $dnums[0]),-2,2) . substr(('0' . $dnums[1]),-2,2), $viapm); < } < } 266c19 < if (preg_match('/' . $previa . $viapm . '/i', $title)) { --- > if (preg_match('/' . $viapm . '/i', $title)) { 268c21 < $obits.=str_replace('65.254.93.32','www.rjmprogramming.com.au',str_replace('65.254.95.247','www.rjmprogramming.com.au',"\n