PHP is an interpreted language; and as such, the computer needs to process the script each time it is run. Honestly, I don’t know much about the internal workings of PHP; so I don’t know how it handles comments in the code. More specifically, I don’t know how well it handles comments. I have seen… Read more »
Posts Categorized: Programming
One of my web projects, like so many others, has a series of pages where data is displayed in a table. Often this data becomes too large for a single page, and it has to be broken down into separate pages. The 5 dollar word for this is pagination, and you’ve seen it; you just… Read more »
Do you ever find yourself needing to shorten a string in PHP? Maybe return the first 25 words of a long story? Give this routine a try. It will return the first n words from a string, or the entire string if it is less than n words long.
Looking at the PHP documentation, it is not clear how to add multiple values for the same case in a switch construct. It seems that you should be able to do But, you can’t. I tried, and it didn’t work. Fortunately, after much searching, I found a way to do it; and it’s not near… Read more »
Open-source FireFox is putting pressure on Microsoft’s dominance of the browser market with over 13 million downloads since November. A companion email program, Thunderbird, was released earlier this month.
It should be pretty easy to get $_GET, $_POST, $_SESSION, or $_COOKIE variables in PHP code. The problem is that just entering $_GET[‘variable’] causes an error if the variable does not exist. What’s needed is a way to open the variable, and get a blank string if the variable is not defined.
If you have a online presence, whether it’s personal or business, you most likely are looking for input back from your visitors. But, be careful if you put your email address in a simple mailto: link. You will get spam, accept it. But, there are a few tricks you can use to limit the spam… Read more »
Often times in PHP you find yourself needing to insert text. Most sites do this by using a database backend, but you also have the option to include data from a text file. Three methods are available for this; require, include, and file_get_contents. Which is fastest, which is best? When should you use one over… Read more »