13 articles PHP Page 3 / 3

Finding hidden line breaks in output for troubleshooting PHP scripts that output to plain text, CSV, and HTML file formats

Sometimes, there are just weird things with line breaks -- it's really hard to tell what type of line break is embedded in certain data.  Sometimes, text entered from a form with line breaks throws the output off, especially if your script needs to break the text or often the data feed down by line…

Accessing URL Query String (Get Variables) inside WordPress through PHP

Adding this to your template file or functions.php in some cases will allow your PHP scripts to access variables passed in the URL query strings.  You know, that ugly text after the Question mark in the website address:  "http://tools.belchamber.us?variable=value&variable2=value".  Most of you probably already figured out just looking at these type of URLs that some…

Connecting to PDO as an object

Moving from procedural with mysql_connect, etc to PDO objects should be an easy transition.  It's so much faster and reliable, too.  The "mysql" library in PHP will soon be deprecated, so you hold-outs won't have a choice.  It's actually less code to write and get whole queries into resulting arrays much faster.  Trust me! Here's…