Skip to content

Search form with PDO

The below code now works but how can I make it so if no results are found it echos a message instead of blank. I think I’ve managed to create a search query for my database. Its only a very basic …

html2canvas save image doesn’t work

I’m rendering a screenshot with html2canvas 0.4.0 and want to save it as image on my webserver. To do so, I’ve written the following function: JavaScript saveJPG.php After the canvas is rendered I can perfectly append it to the HTML body, but saving it on my server result in a corrupted (?) file. …

How to simulate Past-Due status on Subscription

I have setup a PHP script on a cron which contacts Braintree via the API to look up the status of each subscription that we have on file. We then update our local records based on the customer’s subscription status. Because I can manually cancel a subscription from the Braintree control panel, I have be…

Catching exceptions from Guzzle

I’m trying to catch exceptions from a set of tests I’m running on an API I’m developing and I’m using Guzzle to consume the API methods. I’ve got the tests wrapped in a try/catch block but it is still …

How to convert accented chars to html in php?

I have foreign language strings stored in utf8. When displaying them, I want them to be transform in such a way that accented chars become their html counterparts, e.g. é becomes é However …