Result Size: 625 x 571
x
 
<!DOCTYPE html>
<html>
<body>
<?php
$str1 = "Hello";
$str2 = "Hello world!";
echo vsprintf("[%s]",array($str1))."<br>";
echo vsprintf("[%8s]",array($str1))."<br>";
echo vsprintf("[%-8s]",array($str1))."<br>";
echo vsprintf("[%08s]",array($str1))."<br>"; 
echo vsprintf("[%'*8s]",array($str1))."<br>";
echo vsprintf("[%8.8s]",array($str2))."<br>"; 
?>
</body>
<!-- Mirrored from www.w3schools.com/php/phptryit.asp?filename=tryphp_func_string_vsprintf4 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:51:08 GMT -->
</html>
×

Report a Problem: