No Image

Driving in Cincinnati

June 23, 2010 benf101 0

Welcome to Cincinnati, where drivers literally move in front of you while you are on a clear path. They have no reason to move other than they like the appearance of the lane you are in. I have honked at people before to have them move out of the way. […]

No Image

PHP Ternary Operator – The "IF-Else" Shortcut

June 22, 2010 benf101 0

A ternary operator is a quick shortcut to bypass the multi-line if-else statement. It is sufficient when simple setting a value of a variable based on a condition. It looks like this: [php] //     $variable == 10 ? $x = true : $x = false; // [/php] That is saying […]

No Image

PHP explode and trim the results?

June 22, 2010 benf101 3

php.net – where I posted this Overview This is something that I used to use on this site before I went to WordPress. If you checked “view source” and looked at the meta keywords, you would notice a comma separated string. When programming, you may want to take a comma […]

No Image

JavaScript stripslashes

June 19, 2010 benf101 0

Sometimes you have to add slashes to javascript text. PHP has it built in, javascript does not. Here is the code to put into your javascript to get the same functionality: function addslashes(str) {      str=str.replace(/\\\\/g,’\\\\\\\\’);      str=str.replace(/\\’/g,’\\\\\\”);      str=str.replace(/\\”/g,’\\\\”‘);      str=str.replace(/\\0/g,’\\\\0’);      return str; } function stripslashes(str) {      […]

No Image

Creamer Cubes

June 17, 2010 benf101 1

I think someone should invent a little ice cube tray for the purpose of making half and half cubes. Simply poor liquid coffee creamer into the ice cube tray, freeze it, and you have frozen creamers. When it’s time for coffee just drop the cubes into your coffee. As they […]

No Image

MySQL mysqli

June 15, 2010 benf101 0

mysqli is a built in part of mysql 4.1. It incorporates all functionality required to interact with a database from your PHP file. It has basics like querying the database, which includes SELECTing data as well as INSERTing data. It also give the ability to use prepared statements, transactions which […]

No Image

Message To New Programmers

June 15, 2010 benf101 0

So you’re embarking on a programming career, are you? Personally, I’ve been graduated for only 1 year but my experience is technically 2 years, no pun intended, thanks to my co-ops while in college. Before I get so far into my career that I forget my education process I figure […]