3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = 'جام جهانی فیفا2014 فیفا تیم ملی برزیل'; $arr = explode("\n",$test); $C= new stdClass(); $C->AUTO_HASHTAG = $arr; foreach($C->AUTO_HASHTAG as &$ht){ if(strpos($ht,'ا')!==false) $C->AUTO_HASHTAG[] = str_replace('ا','آ',$ht); if(strpos($ht,'آ')!==false) $C->AUTO_HASHTAG[] = str_replace('آ','ا',$ht); if(strpos($ht,' ')!==false){ $C->AUTO_HASHTAG[] = str_replace(' ','-',$ht); $C->AUTO_HASHTAG[] = str_replace(' ','_',$ht); } } var_export($C->AUTO_HASHTAG);

preferences:
42.22 ms | 402 KiB | 5 Q