Blog

Archive for the PHP Category


PHP Classes and Objects Examples
Posted on March 22, 2018 in PHP by Matt Jennings

/*
public – the property or method can be accessed from everywhere. This is default
protected – the property or method can …

Read more


Most Popular PHP String Functions
Posted on March 21, 2018 in PHP by Matt Jennings

// Example string
$blog = ‘Your blog is Excellent!’;

// returns ‘our blog is Excellent!’
substr($blog, 1);

// returns ‘xcellent!’
substr($blog, -9);

// returns ‘Your’
substr($blog, 0, …

Read more


WordPress PHP and MySQL Code Cheat Sheet
Posted on November 17, 2017 in PHP, WordPress by Matt Jennings

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<?php the_content(); ?>

<?php endwhile; endif; ?>

<h2 class=”clear”>Featured Projects</h2>

Read more


PHP Regular Expression Examples using preg_match()
Posted on January 25, 2016 in PHP, Regular Expressions by Matt Jennings

<?php
function test($my_pattern, $my_string) {
$output = ‘<p><strong>My String:</strong><br />’ . $my_string . ‘</p>’;
$output .= ‘<p><strong>My Pattern:</strong><br />’ …

Read more


Creating Custom Post Types, with Multiple Text Fields in a Single Meta Box and Template Info, in WordPress
Posted on October 31, 2015 in PHP, WordPress by Matt Jennings

Below are WordPress and PHP code samples on how to:

Create custom post types using a plugin.
Create multiple text fields (using …

Read more