News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
feed this:

David Otton's Blog:
Neat PHP tricks Casting Arrays to Objects
August 14, 2008 @ 13:38:10

David Otton has a handy little tip if you're looking for a cleaner way to deal with array data - casting it to an object.

Array notation is fine, but it can look a bit clunky when you're working with complex structures. [...] Casting the array to an object allows us to use object notation (->) and makes the code more readable.

He includes examples of the casting, showing the difference between the array and object notations including a method for creating an object based on a simple array that has basic properties built in. This sort of transformation can be useful if you want consistency through out the application - just passing objects with their properties rather than arrays.

0 comments voice your opinion now!
array object casting trick notation readable



Nick Halstead's Blog:
Reverse Polish Notation in PHP
August 06, 2007 @ 16:56:00

As a follow up to a previous post where he discussed reverse polish notation, Nick Halstead has decided to split off the code he created for that previous post into a new, sleeker post without much of the explanation and heavy on the code.

My last post about back to basics covered reverse polish notation including a link to a RPN parser which I wrote to allow people to learn by example (best way in my opinion and in yours). The post got quite long and the PHP code was not really relevant to the subject so I have decided to include in this separate post instead.

There's two parts to the post - a pseudo-code explanation that an overview of how things work and the actual code, a block of code (in the 30 line area) that runs through each item and, based on a token, pushes the value into the array differently.

1 comment voice your opinion now!
polish notation reverse pseudocode polish notation reverse pseudocode


Utah PHP Users Group:
PHP and JSON
January 25, 2006 @ 06:30:14

According to this post on the Utah PHP User Group's website today, there's been talk of adding JSON support to the Core portion of the PHP distributions.

There has been some recent activity on the PHP Developer mailing list about the addition of JSON into the PHP Core. After reading the thread, I did a little research on JavaScript Object Notation (JSON). Here is a great website to read more about it.

You can check out the discussion over on the archived copy of the php-dev mailing list...

0 comments voice your opinion now!
php json add to core javascript object notation php json add to core javascript object notation



Community Events









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


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

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