Using Strings-Extracting

Substring From start of string From end of string Get String Before & After Character/String If Present Remove First Word In A String Remove Last Word In A String Get String Before First Occurrence Of A String Get String After First Occurrence Of A String Neat way of getting just the string after the search string: Getting […]

Read More

Using Strings-Searching Strings

Does String Contain String str_contains strpos() strpos ($haystack , $needle , $offset = 0 ) Returns False on no match or first occurrence index (from 0) on match Does string start with Does string end with

Read More

INSERT

Was INSERT sucessful? Get Auto ID Of New Record The insert_id() function returns the auto generated id used in the latest querywith a column having the AUTO_INCREMENT attribute.

Read More

Alter Page

Use A Shortcode You can add a shortcode to the page and a function for it to add dynamic content, javascript, etc

Read More

Redirect to page

Before outputting page content Redirect based on the home URL Redirect based on the site URL If you’ve outputted some page content Using a META tag is the easiest way Redirect on “Page not found” Create a page called 404.php. Place this code in it:

Read More

Strange Errors Checklist

Heredoc string ( $MyString = <<<_END ) terminating markers The terminating marker must be at the start of a line and also the only thing on the line – no comment or even whitespace after it!!!

Read More