Duke's Blog

PHP

PHP str_replace() Function

The PHP function str_replace()
str_replace(find,replace,string,count)
Example
echo str_replace("find","Positive","Turn a Negative to a find .");
Displays:
Turn a Negative to a Positive .
catagory: PHP
tags: tutorial

PHP strlen() Function

The PHP function strlen() returns the length of a string.
strlen(string)
Example
echo strlen("Hello Duke");
Displays:
10
catagory: PHP
tags: tutorial

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

Graffiti on a building wall

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