3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $length = 4; $string = "ABCDEF"; $string = substr_replace($string,"",$length); $string = str_pad($string,$length," ",STR_PAD_RIGHT); echo $string;
Output for 4.3.0 - 7.1.0
ABCD