Articles → PHP → Substr Function In PHP
Substr Function In PHP
Purpose
Syntax
substr(string, start_position, number_of_characters_from_start_position)
Example
<!DOCTYPE html>
<html>
<body>
<?php
echo substr("This is the demo of substr function in php",12, 4);
?>
</body>
</html>
Output
Click to Enlarge