PHP String

Last Updated: January 24, 2022

The string is a sequence of characters like “Hello World”

There are string manipulation functions in PHP

Padding String in PHP

echo str_pad($i, 2, "0", STR_PAD_LEFT); 

If $i=9 then you can get output 02. Similarly, you can do the right padding with STR_PAD_RIGHT