3v4l.org

run code in 300+ PHP versions simultaneously
<?php $textDump = "apple running google"; $keyWordsSports = array("nba", "raptor", "ufc", "basektball", "gym", "mma", "realgm", "running"); $keyWordsTech = array("apple", "rim", "blackberry", "facebook", "twitter", "google" ); $keywords = array("sports"=>$keyWordsSports, "tech"=>$keyWordsTech); $count=array("sports"=>0,"tech"=>0); foreach ($keywords as $key=>$item){ foreach ($item as $newItem){ $count[$key] += substr_count(strtolower($textDump), strtolower($newItem)); } } print_r($count);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [sports] => 1 [tech] => 2 )

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