3v4l.org

run code in 300+ PHP versions simultaneously
<?php $poxBox = array(); $poxBox[] = 'POBOX'; $poxBox[] = 'P.O\.'; $poxBox[] = 'P.O'; $poxBox[] = 'PO\.'; $poxBox[] = 'APO.'; $poxBox[] = 'A.P.O\.'; $poxBox[] = 'A.P.O'; $poxBox[] = 'GPO\.'; $poxBox[] = 'G.P.O\.'; $poxBox[] = 'G.P.O'; $poxBox[] = 'N.O\.'; $poxBox[] = 'N.O'; $poxBox[] = 'P.O.Box'; $poxBox[] = 'P.OBox'; $poxBox[] = 'PO.Box'; $poxBox[] = 'PO Box'; $poxBox[] = 'APO'; $poxBox[] = 'FPO'; $poxBox[] = 'PO'; $street1='po'; $isMatch = false; for($i =0 ; $i<count($poxBox); $i++){ $pattern = strtolower(trim($poxBox[$i])); $pos = preg_match('/\b'.$pattern.'\b/', $street1,$match); if ($pos) { // if ( preg_match('/'.$pattern.'/', $street1)){ $isMatch = 1; break; }else{ $isMatch = 2; } } echo $isMatch ;
Output for git.master, git.master_jit, rfc.property-hooks
1

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
43.13 ms | 401 KiB | 8 Q