 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
David Otton's Blog: Stupid PHP Tricks Illegal Variable Names
by Chris Cornutt 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.
voice your opinion now!
variable trick illegal name compact curlybrace
DevShed: Retrieving Information on Selected Files with a PHP 5 File Uploader
by Chris Cornutt 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.
voice your opinion now!
tutorial php5 file upload information mime name size
David Coallier's Blog: Namespaces part 4.1 (What namespaces don't fix (part 1))
by Chris Cornutt 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.
voice your opinion now!
namespace support long class name fix namespace support long class name fix
|
Community Events
Don't see your event here? Let us know!
|