Duke's Blog

All

PHP str_pad() Function

The str_pad() PHP function pads a string to a new length.
str_pad(string,length,pad_string,pad_type)
Example
$str = "Hello World";
echo str_pad($str,20,"."STR_PAD_LEFT);
Displays:
...................Hello World
catagory: PHP
tags: tutorial

My Pictures

Pond In Norwood Ma

This blog will contain posts that seem relevent and interesting to me. I hope you also enjoy them and find this blog useful.


I am using a model view controller (MVC) pattern for this web page. I using PHP for the controller, HTML for the view and for the modal mySQL. I also developed a Filemaker solution. The FM solution stores the blog data. I use the execute SQL script to upload, edit and delete all blog post data. The code can be found on GitHub. PHP files on GitHub. HTML file on GitHub