News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
feed this:

David Otton's Blog:
Stupid PHP Tricks Illegal Variable Names
August 22, 2008 @ 13:47:52

David Otton has shared another of his "stupid PHP tricks" on his blog today. This one looks at illegal variable names that don't match the "can't start with a number" rule the manual points out.

A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: '[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*'

Technically, you can get around this in two different ways - variable varaibles and the more complex notation with curly braces. He points to the compact function for proof that they're set.

0 comments voice your opinion now!
variable trick illegal name compact curlybrace



Amir Saied's Blog:
PEAR bash completion
July 28, 2008 @ 12:08:29

Amir Saied recently posted a handy little tool for the PEAR users out there - a bash script that handles tab completion for you.

Lately I've been playing alot with the PEAR CLI. The one annoying thing I noticed the most was its lack of tab completion that I'm used to from the shell. It turns out that this feature is very easy to add, in the bash at least.

It will finish off the PEAR commands for you and expand out the PEAR package names and discovered channels when it finds a match. You can download the package here.

0 comments voice your opinion now!
pear bash commandline completion tab package name channel


DevShed:
Retrieving Information on Selected Files with a PHP 5 File Uploader
March 27, 2008 @ 09:31:04

DevShed has continued their series (here's part one) looking at the use of file uploading in your PHP scripts. They build on that foundation and add in some more useful features this time:

The initial script in the first tutorial of this series lacked some important features, such as the implementation of an effective error handling module and the ability to check the MIME type and size of the file being uploaded. In this second installment of the series, I'm going to improve the logic of the script from the first tutorial to provide it with the capacity to retrieve useful information concerning the entire file uploading process.

They look back at the previous tutorial to remind you of some of the concepts and then move on to show you how to get information about the file (like the MIME type, name and size of the uploaded file). The last page is just the full source code for the cut and pasters out there.

0 comments voice your opinion now!
tutorial php5 file upload information mime name size


Funcaday.com:
Special Valentines Day Edition (isLove)
February 14, 2008 @ 08:49:00

Besides all of the usual Valentines day logo fun from some of the major sites out there, Paul Reinheimer also points out a special little something on the Funcaday.com website:

Want a custom one to share with someone you care about. Fill out the form here. It's a subtle effect though, they'll need to read it. Valid characters for names are just alphabetics and the underscore, sorry.

The custom output is a great little addition to the site - put in person one's name and person two's name and it updates the image to show the new parameters. Ah, geek love...

0 comments voice your opinion now!
valentine islove custom name input


The Northclick Blog:
Announcing "dropr" - the message queue framework for PHP
December 10, 2007 @ 08:48:00

On the Northclick Blog Soenke Ruempler has shared the new name for their message queue software they're developing (see here) - dropr.

Why? When Boris was writing the client angel script he somehow named it "dropr". As we neither got better suggestions nor had any other idea we just decided for this name. Actually the name is a little bit fun because all those stupidR startupRs. But it's nice and somehow our framework drops message into queues.

Check out the project's homepage for more information including installation instructions, methods to download the latest version, some FAQs and a roadmap for where the project's going.

0 comments voice your opinion now!
dropr message queue framework name trac dropr message queue framework name trac


Stefan Koopmanschap's Blog:
Tip use clearly readable variable names, and constants!
December 05, 2007 @ 12:05:00

Stefan Koopmanschap has a good reminder for developers out there in a new post to his blog - make your code much easier to understand via readable variable names and constants.

Yes, you know what code you write and you also know how it works. You can find your way around it. But what if you haven't touched a piece of code for months or even years. Or what if someone else needs to work with your code. Prevent a hell: use clearly readable variable names and constants.

He points out an example of what not to do - a specific line from the FUDForum code with multiple variables named with a single letter of the alphabet in a complex if() evaluation. He suggests even using "namespacing" of sorts (PHP6 here we come!) to help compartmentalize your variables to make things even easier.

0 comments voice your opinion now!
clearly readable variable name constant namespace clearly readable variable name constant namespace


Hasin Hayder's Blog:
Did you know 'you can have cheese burger' could be a variable name?
October 24, 2007 @ 08:57:00

Hasin Hayder has a quick tip for users of SimpleXML - a handy way to access a node in an XML document that has unsupported characters in its name.

I was finding a way to refer that element as a SimpleXMLElement and found a nifty note in PHP Manual. It says if you have unsupported (unsupported in PHP Lexicon for a variable name) characters inside the name of a node, you can access it using a special pattern {'name'}.

In his example, he shows how a popular phrase ("i can have cheese burger") can be used as the variable name despite having spaces in it.

0 comments voice your opinion now!
variable name unsupported character special pattern variable name unsupported character special pattern


Derick Rethans's Blog:
HTML name attribute deprecated
October 23, 2007 @ 12:52:00

Derick Rethans has pointed out a "gotcha" that was passed along to him (somewhat incorrectly) about the "name" attribute being deprecated in XHTML 1.0.

Just now somebody on IRC was claiming that the "name" attribute in HTML - the one that is used to give form input fields a name to be used in $_GET and _$POST in PHP is in fact deprecated. [...] But if you read correctly, it's only for the elements: a, applet, form, frame, iframe, img, and map.

For the official information, check out the section of the new spec dealing with this transition.

0 comments voice your opinion now!
name attribute xhtml deprecated element name attribute xhtml deprecated element


David Coallier's Blog:
Namespaces part 4.1 (What namespaces don't fix (part 1))
October 03, 2007 @ 14:36:00

David Coallier continuing his look at the upcoming namespace support in PHP, has posted some a bit more negative than some of his previous posts - this time it's about what namespaces don't fix.

Anyways, after posting a few articles about namespaces and now that the patch has been ported to the php 5.3 branch, people are actually starting to use it. The side effects of people (without too much knowledge or thinking about the implementation of namespaces) is that they are actually realizing that namespaces are not the promised land.

To illustrate his point, David gives something that namespaces just won't fix - long class names. It doesn't matter if you're using them in the Project_Package_Class or (with namespaces) Project::Package::Class format, you're still stuck with the long names. Keep an eye out for more similar articles from David to demystify other incorrect namespace impressions.

0 comments voice your opinion now!
namespace support long class name fix namespace support long class name fix


Philip Olson's Blog:
20 possible reasons why PHP function names and parameters are weird
May 29, 2007 @ 07:04:00

For your consideration today, Philip Olson has worked up a listing of twenty (humorous) possible reasons that the names of the PHP functions are weird.

Here are 20 possible reasons why PHP functions lack consistent names and parameters. Learning the definition for every PHP function is truly an amazing feat and I doubt this has been attempted or accomplished by anyone. At least, by any sane human. And references are named references because they are designed to be referenced, right?

Items on the list include:

  • PHP likes BC
  • PHP says all your namespace are belong to us
  • PHP function naming algorithm still remains a secret and cannot be cracked
  • PHP isn't designed to win a beauty contest

0 comments voice your opinion now!
function name parameter list weird function name parameter list weird



Community Events











Don't see your event here?
Let us know!


cakephp mysql job zend PHP5 release framework zendframework example releases package conference book developer PEAR security code database application ajax

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework