php substring – The Best PHP 3 Examples

Today, We want to share with you php substring.In this post we will show you php string length, hear for PHP string contains we will give you demo and example for implement.In this post, we will learn about How To Check If String Contains A Substring In PHP? with an example.

php substring

Example : 1 PHP substr() Function

<!DOCTYPE html>

echo substr("Welcome Pakainfo",6);


Example : 2 PHP String Substr Example | PHP Substr() Function


// index.php

echo substr("Pakainfo", 3)."\n";
echo substr("W3diy", 2)."\n";
echo substr("Infinityknow", 7)."\n";
echo substr("Examples", 4)."\n";

Example : 3


// index.php

echo substr("Pakainfo", -3)."\n";
echo substr("W3diy", -2)."\n";
echo substr("Infinityknow", -7)."\n";
echo substr("Examples",-4)."\n";

I hope you get an idea about php substring.
I would like to have feedback on my
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Also Read This 👉   How to Print Arrays in PHP?