Blog
Archive for the PHP Category
Class Example, Object, and Access Modifiers (Public, Private, Protected) Examples
/*
public – the property or method can be accessed from everywhere.
Read more…
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…
The Loop
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
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…
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 ↑