.


Divya

substr() function in php


The substr() function is used to returns a part of a string in PHP.

Syntax

substr(string,start,length)

In this example John is the first name and Deo is the last name and we show you only the first name.

Example

<!DOCTYPE html>
<html>
<body>
<?php
$name=substr("John Deo",5);
echo $name;
?>
</body>
</html>


.