Posts Tagged "PHP"

Spewing JavaScript JSON with PHP

There may be a time in the not so distant future where your employer may ask you do develop a web application which will hook up with a JSON data source. Perhaps you will be like "Uhhhhhh" and have a dumb look on your face. Have no worries, the underground is here to help! Lets use some PHP to generate some JSON code which we will fetch via AJAX and ...

Directory Tree Script with PHP

The old saying goes "The world is but a file and I, a lonely man, shall list it in the cosmos!" Ok, I made up the new old saying but haven't you ever wanted to add a basic file directory listing script to use with your own file manager? Maybe something that can simply list the contents of a directory (its subfolders and files) and even make them expandable/collapsible like ...

Selection Sort (Definitive Series)

In a long standing tradition here on the Programming Underground we are going to add another entry to the definitive series. For those of you who are still relatively new to my blog, the definitive series is a series of blog entries where we take an algorithm and run it through the paces of five different languages: C++/C#/Java/VB.NET/PHP. With the code side by side we can see the similarities as ...

Finding a Loan Balance in PHP

"Yes sir, I will take that 10,000 dollar loan. If I pay 100 dollars a month that will be $1200 dollars right there after my first year." Not so fast the bank teller tells you. You still owe us $9383 and some change, not $8800. You have to remember interest and at your monthly compoundings, it adds up! Damn that interest really hits home. Here I thought I had 1200 ...

Programming Tip: Control Your Whitespace

I am writing this blog entry to talk to all the programmers out there, who post regularly post on the board, who are in the industry, who are new or who are experienced... code organization is key to a great looking program and to help reduce your debugging troubles. Often times I sit on the Dream.In.Code web board helping out when I am suddenly hit with a post that is ...

Creating an Online Quiz with PHP

Damn! A Dream.In.Code quiz can be tough I tell you. So many questions, so many answers, so little time! Like the question here "How many times have you been told you are a liar, you must die, or have been put in context of being some freak of nature by Supersloth?" Uhhh... Maybe there is a choice for how many times I have NOT been called one of those ...