PHP Str_Pad_Left, Str_Pad_Right, Or Str_Pad_Both: – String Function

<?
    $string = "Goodbye, Perl!";
    $a = str_pad($string, 10, '-', STR_PAD_LEFT);    $b = str_pad($string, 10, '-', STR_PAD_RIGHT);    $c = str_pad($string, 10, '-', STR_PAD_BOTH);
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.