3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = "abcdefgh"; $firstChar = substr($string,0,1); $lastChar = substr($string,-1); $stars = str_pad("",strlen($string) -2, "*"); $output = $firstChar . $stars . $lastChar; echo $output;
Output for 4.3.0 - 7.1.0
a******h