PHP makes file system manipulation easy with its variety of built-in functions. One thing I always knew, but never got the chance to try, is that many of those same functions worked over FTP instead of the local file system. I finally got my excuse to give it the ole' college try and I found a few things that may help others with the same task.

-Read More

PHPEvery good programmer should constantly be looking for ways to improve the look and readability of their code. One of my favorite ways to reduce vertical length while maintaining readability is to use the lesser-known ternary comparison operator.

The Ternary Operator is unique when it comes to PHP's available comparison options. Not in the sense that it does something that the other operators don't, but that the functionality it offers is not seen anywhere else.

<?php
  $myvar 
= ($x == $y) ? TRUE FALSE;
?>

-Read More

PHPNoticing your pages are loading slowly or just don't like using extra cpu cycles when you don't have to? PHP makes caching very easy with their variety of Output Control Functions. In this article I'll go over complete page caching which is the easiest to implement and understand.

-Read More

MySQLRelational Database Design is one of the most powerful ways to ensure data integrity and a great way to kick-off any project. Very often the first thing developers do when starting a new project, or stub-project, is to design the database. This way the structure of the application is already in place and we just have to fill in the pieces with some server-side code. I've found when adding relational constraints to your database design you add in a very powerful error reporting tool that will let you know during the development process that you have allowed something to happen that shouldn't have. In this article, I go through, step by step, showing how to set up a simple relational database and discuss the benefits that are enjoyed.

-Read More

Wamp ServerBeing able to develop on my local machine with urls like htto://testsite/index.php has been a godsend. Mostly because I am able to take full advantage of the document root. If I were to develop on something like http://localhost/testsite/index.php I would be extremely limited and forced to used relative urls. In this article I've listed the steps in order to enable this functionality in a wamp server environment.

-Read More

Blake over at PHP vs .NET has written up a very nice article to prepare those who are interviewing for a php job soon. He basically gives a bunch of php snippets and asks where the bugs are. The article somewhat morphs into a mish-mash of good-practice/bad-practice comparison and explains why one way is better than the other.

From the article:

Find the errors in the following code:

<?php
function 
baz($y $z) {
    
$x = new Array();
    
$x[sales]  = 60;
    
$x[profit] = 20:

    foreach(
$x as $key $value) {
        echo 
$key+" \"+$value+\"<BR>\";
    }

?>

-Read More

< 1 2 3

4

5 6 7 >