Blog

Archive for the PHP Category


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

Class Example, Object, and Access Modifiers (Public, Private, Protected) Examples

/*
public – the property or method can be accessed from everywhere.
Read more…


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

substr()

// 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

The Loop

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

<?php the_content(); ?>

<?php endwhile; endif; ?>

Custom Post
Read more…


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

Example PHP Function Using preg_match() to Regular Expressions Against Strings

<?php
function test($my_pattern, $my_string) {
$output = ‘<p><strong>My String:</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…

To Top ↑