RSS

Tag Archives: str_pad()

str_pad()

str_pad()
<?php
$input = “Joker”;
echo str_pad($input, 10);                                                     // produces “Joker     “
echo str_pad($input, 10, “-=”, STR_PAD_LEFT);       // produces “-=-=-Joker”
echo str_pad($input, 10, “_”, STR_PAD_BOTH);        // produces “__Joker___”
echo str_pad($input, 6 , “___”);                                        // produces “Joker_”
?>

 
Leave a comment

Posted by on September 8, 2009 in PHP

 

Tags: ,

 
Follow

Get every new post delivered to your Inbox.