Tagged: PHP

Dynamic Field Sorting for WordPress ACF

A site my employer has uses the Advance Custom Fields plugin for WordPress. They use the plugin to create custom post types which they use for creating product pages. This plugin allows you to...

Form Variables not Passing Integers

is_int() vs is_numeric() One great way to handle security it to make sure that your code is expecting the type of input it needs, rather than what it gets.  For example if you code...

Make a Form Cancel Button

The Cancel Button You are making an edit form for a site. The form allows a users to make changes to something and submit the changes to the database. This is a typical scenario...

Regex: Match everything between two things

Ohh the adventures of regular expressions!!!  I’ve been beating my head against the wall with this one.  I have a long string filled with all kinds of characters and variables and I need to...

Storing and sorting Values in PHP Array

Storing and sorting Values in PHP Array

I just had a huge ordeal dealing with an array.  I needed to loop through an array – process some tasks – then return a value and store that value along with another value...

Regular Expression Anything In Between Two strings

Regular Expression Anything In Between Two strings

$pattern = ‘/(?<=customProgramName=\’)(.*?)(?=\’)/’; Matches anything after “customProgramName=’ ” and before the closing ” ‘ “. Took me forever to figure this out!!!! Good Examples Look Behind and Look Ahead

CryptoPHP issues with WordPress

I just found out that my IP for this server has been listed with Spamhaus due to a cryptoPHP hack on wordpress.  I did some research and am not getting very far.  Seems that...

HTML to PDF Resources

I’m looking for some options to convert html to PDF.  There are a few reasons to do this.  The main reason is that I want a pretty print version of a report that can...

Remove or edit .php or .html from URL

If you are using a web server running Apache you can easily remove extensions from the url by using the Rewrite command inside of your .htaccess file.  What this allows you to do is...