3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $days_of_week = array("monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"); function stringParse(array $string) { for($i = 0; $i < count($string); $i++) { $string = str_replace($string[$i], substr($string[$i],0,3), $string); echo $string[$i].'<br />'; } return $string; } $days_of_week = stringParse($days_of_week); foreach($days_of_week as $stry) {echo $stry.'<br />';}
based on I2rKj
Output for 5.3.22 - 7.3.0rc4
mon<br />tue<br />wed<br />thu<br />fri<br />sat<br />sun<br />mon<br />tue<br />wed<br />thu<br />fri<br />sat<br />sun<br />