3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $name = "IPC_IPCamera_13_7_24_9_57_45.jpg"; $parts = explode("_", $name); for ($i = 0; $i < count($parts); $i++) { $part = $parts[$i]; if (count($part) == 1) { $part = "0" . $part; } $name .= $part . "_"; } echo $name;
Output for 7.2.0 - 7.3.0rc4
Warning: count(): Parameter must be an array or an object that implements Countable in /in/mmTb3 on line 10 Warning: count(): Parameter must be an array or an object that implements Countable in /in/mmTb3 on line 10 Warning: count(): Parameter must be an array or an object that implements Countable in /in/mmTb3 on line 10 Warning: count(): Parameter must be an array or an object that implements Countable in /in/mmTb3 on line 10 Warning: count(): Parameter must be an array or an object that implements Countable in /in/mmTb3 on line 10 Warning: count(): Parameter must be an array or an object that implements Countable in /in/mmTb3 on line 10 Warning: count(): Parameter must be an array or an object that implements Countable in /in/mmTb3 on line 10 Warning: count(): Parameter must be an array or an object that implements Countable in /in/mmTb3 on line 10 IPC_IPCamera_13_7_24_9_57_45.jpg0IPC_0IPCamera_013_07_024_09_057_045.jpg_
Output for 4.3.0 - 7.1.20
IPC_IPCamera_13_7_24_9_57_45.jpg0IPC_0IPCamera_013_07_024_09_057_045.jpg_