Many complex things are extremely simple in PHP – sending mail is one of them. Here’s how: // components for our email $recepients = 'you@somewhere.com'; $subject = 'Hello from...
Learn MoreBefore we execute a shell command from PHP it’s a good idea to test if the server will respond to it. We can do this by making use of the empty() function. The following example consists of a helper...
Learn MoreIf we’re executing shell commands via PHP we need to know if the server is running Windows or Linux. Thanks to a magic constant in PHP we can find out like this: echo PHP_OS; This will give us a single...
Learn MoreTo get the directory of the current theme (or child theme) you can use get_stylesheet_directory_uri(). Here’s how to use it. Let’s assume that your WordPress installation lives in http://demo.com,...
Learn MoreI tested one of my plugins yesterday and was shocked to see a nasty error message: What was going on? I could have sworn this worked fine last time I tried! Then I remembered that I changed my PHP Version in...
Learn More