3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $tags = ' #vienna #wien #austria #view #travel #sky #holiday #vacation #ig_europe #landmark #reflections #ocean #europe #austrian #reflection #water #people #sea #pretty #fun #street #lighthouse #skyline #topeuropephotos #photo #photos #river #city #sunset ' ; $pcs = array_map('trim', explode('#', $tags)); $found=[]; foreach($pcs as $piece){ if (array_key_exists($piece, $found)){ var_dump("tag already found: $piece"); continue; } $found[$piece]=true; } var_dump("found ".count($found)." tags");
Output for 7.3.0rc3
string(13) "found 30 tags"