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. Read more »
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
case ("whatever" || "something"): //Do something; break;
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 as difficult as I was making it. 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. Read more »
An asteroid has been rated as a level four threat to the Earth on a scale out of 10. This marks the first time that an asteroid has been rated higher than 1. Currently, there is a 1 in 45 chance that this asteroid will collide with the Earth on Friday, April 13th, 2029. Read more »
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. Read more »
Sophos, a UK based research group, recently released statistics putting Ameria square at the top of the list of spamming countries at 42.1%. South Korea is in second place with 13.4%; with China, Canada, and Brazil filling out the top 5.
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 you get. Read more »
America Online may not be winning the war against spam, but it they may at least be making a run at it. AOL is claiming a dramatic decline in spam volume for the first time in 5 years. Read more »
Since several of my posts have source code in them, I needed a way to syntax highlight. I found a pretty good one for PHP code, but it didn’t do anything else.