3v4l.org

run code in 300+ PHP versions simultaneously
<?php $phrases = array("NEW YORK NY", "NEW JERSEY", "SOUTH DAKOTA", "SOUTH CAROLINA", "COMPUTER REPAIR TECH","YORK NY","07728","WYOMING MI","WYOMING MINNESOTA"); $string = ("I live in wyoming Minnesota, but used to live in New Jersey 07728 working as a computer repair tech."); $string = strtoupper($string); $matches = stringSearch($phrases, $string); function stringSearch($phrases, $string){ $phrases1 = trim(implode('|', $phrases)); $phrases1 = str_replace(' ', '\s', $phrases1); preg_match_all("/$phrases1/s", $string, $matches); $value = implode(' ', array_filter($matches[0])); echo $value; }
Output for git.master, git.master_jit, rfc.property-hooks
WYOMING MI NEW JERSEY 07728 COMPUTER REPAIR TECH

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:
32.43 ms | 401 KiB | 8 Q