How to use substr in PHP

In this article I will explain how substr function can be used in PHP.
  • 1475

substr() function

This function returns a part of a string.

Syntax

substr(string,start,length)

Example

<html>
<body>
<?php
echo substr("Hello Ankita!",6);
?>
</body>
</html>

 

Output


substr-php.jpg

You may also want to read these related articles Click here

Ask Your Question

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.