Result Size: 625 x 571
x
 
<!DOCTYPE html>
<html>
<body>
<?php
// Positive numbers:
echo substr("Hello world",0,10)."<br>";
echo substr("Hello world",1,8)."<br>";
echo substr("Hello world",0,5)."<br>";
echo substr("Hello world",6,6)."<br>";
echo "<br>";
// Negative numbers:
echo substr("Hello world",0,-1)."<br>";
echo substr("Hello world",-10,-2)."<br>";
echo substr("Hello world",0,-6)."<br>";
?>
</body>
<!-- Mirrored from www.w3schools.com/php/phptryit.asp?filename=tryphp_func_string_substr3 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:51:07 GMT -->
</html>
×

Report a Problem: