News Feed
Sections

News Archive
feed this:

ProDevTips.com:
jQuery JSON with PHP json_encode and json_decode
August 18, 2008 @ 10:22:04

On the ProDevTips blog, Henrik shows an example of the "perfect combination" of PHP's json functionality and a powerful javascript library, jQuery.

Today I looked for a replacement for my old jspanserializer.js script that I can't even remember where I found anymore. Turns out that I wont have to either, I can forget it. From now on I'll use jQuery JSON instead.

A code example is included to show the simplicity.

0 comments voice your opinion now!
json jquery jsonencode jsondecode example code



NETTUTS.com:
Creating a Dynamic Poll with jQuery and PHP
July 25, 2008 @ 10:22:05

The NETTUTS.com website has a new tutorial posted that combines PHP and AJAX (using the the jQuery library specifically) to create a simple dynamic poll.

When you combine some neat functionality courtesy of PHP with the cleverness of jQuery you can produce some pretty cool results. In this tutorial we'll create a poll using PHP and XHTML, then make use of some jQuery Ajax effects to eliminate the need for a page refresh, and to give it a nice little bit of animation.

The PHP handles defining the question, answers and the functionality to load, submit and return the current results (number of votes) back to the javascript. The communication between the PHP and javascript is a JSON message made simple thanks to PHP's json_encode function.

You can download the source or check out a live demo to see how it all fits together.

0 comments voice your opinion now!
jquery javascript json poll dynamic demo download tutorial


ProDevTips Blog:
Fluent Arrays and Strings in PHP - Adding JSON and more
July 17, 2008 @ 09:32:26

Henrik continues his look at fluent arrays and strings in PHP with this second part of his series, adding JSON functionality into the mix.

Recently I've had the need to extend the interface further, among other things with JSON support. I've used code published by Nicolas Crovatti to do this.

His example shows how the script works to plot out some points for a table of stats. He follows this with an in-depth look at the different methods making up that fluent call (apply2Field, fill_ret, sum and plot). These make the array that can then be passed off to PHP, using json_encode to make an easy-consumable JSON message out of the results.

0 comments voice your opinion now!
json fluent array string php5 tutorial jsonencode


Jake Blauzier's Blog:
Event-Based AJAX Framework for PHP
June 12, 2008 @ 11:18:31

Jake Blauzier has just posted the last part of his series focusing on the creation of an event-based Ajax framework that works with PHP. It allows for calls to static functions, can return Javascript representations of PHP objects and a "call queue" system to keep things from overlapping.

Here's the list of the parts of the series:

  • Part 1 - introduction, sample usage
  • Part 2 - problems in making an event-based ajax callback model (and his solutions)
  • Part 3 - the use of JSON in the framework
  • Part 4 - implementation of the Scriptifiable interface
  • Part 5 - implementing the Remotable interface

You can download the latest version of his Ajax framework directly from his blog.

0 comments voice your opinion now!
eventbased ajax framework series json callback scriptifiable remotable


Brian Moon's Blog:
Stupid PHP Tricks Normalizing SimpleXML Data
June 03, 2008 @ 09:34:22

Brian Moon has a "stupid PHP trick" posted to his blog today - normalizing SimpleXML data you've pulled in from just about any external source.

Anyhow, one annoying thing about SimpleXML has to do with caching. When using web services, we often cache the contents we get back. We were having a problem where we would get an error about a SimpleXML node not existing.

They were using memcache to store the information but came across problems when their code tried to use a (sometimes) empty tag. He gives two solutions - one using a recursive function that identifies the empty items and the other that encodes then decodes the object to and from JSON, keeping the values intact.

0 comments voice your opinion now!
trick stupid simplexml normalize json recursive empty tag


Marco Tabini's Blog:
5 PHP 5 features you can't afford to ignore
April 29, 2008 @ 17:06:45

Marco Tabini has posted his list of what he considers five features of PHP5 that you "can't afford to ignore" when doing your development work:

Despite the fact that you may not have a choice in the matter, upgrading comes with a number of bonus new features that can help you write better code and gain access to new functionality that required a fair amount of hacking in previous version. Here's a quick list of 5 personal favourites.

The feature to make his list are SimpleXML, JSON/SOAP, PDO, the Standard PHP Library and SQLite. Each has their own bonus feature(s) included too for a little extra incentive to check them out.

0 comments voice your opinion now!
php5 feature list ignore simplexml json soap pdo spl sqlite


Michael Girouard's Blog:
Rolling Your Own MVC The View
April 28, 2008 @ 09:39:45

Michael is back with part three of his series stepping you through the creation of your own MVC framework (Part 1 and Part 2) with a look at the part that interfaces with the user - the View.

Using the view as a starting point may seem odd at first considering the view-related actions are some of the last steps in the page load scenario, but since our views don't have any external dependencies, unit tests are very easy to write and so is the accompanying code.

He explains how views work along with the rest of the framework and some of the basic rules surrounding how they get their data. Code comes along with the explanations for different views like XML, HTML and JSON methods of output.

0 comments voice your opinion now!
modelviewcontroller mvc view tutorial output xml html json


Cal Evans' Blog:
I called Zend_Jsonencode(), so WTH are all my properties?
February 22, 2008 @ 12:10:00

In dealing with a little JSON encoding and objects in a project of his recently, Cal Evans bumped against a problem when he was encoding an object and moving it back and forth between the back and front ends.

The problem is simple, JSON encode a PHP object and send it back to the front end. Sounds simple and the last 100 times I wrote this code it was simple. This time, I was too smart for my own good. Here's the scenario.

He illustrates his problem - the "dropping" of properties somewhere along the way - with a sample class that encodes the object and sends it along. He missed one key bit of information, though. His protected array of properties wasn't getting passed back out correctly and we're in the resulting JSON message. A quick hack of a getProperties() function call made this problem a thing of the past.

0 comments voice your opinion now!
zendframework json encode property getproperties problem


John Coggeshall's Blog:
Alan has smoked too much PHP
November 16, 2007 @ 07:58:00

In a new post to his blog today, John Coggeshall comments on some thoughts from Alan Knowles about a method for making PHP obsolete.

Alan, I think you were smoking way too much PHP when you wrote this post.. This in particular really surprised me to hear you say [that a module that made mysql stored procedure calls based on a URL and returned JSON could make PHP obsolete]. While I do understand the concept your explaining, I simply can't see how the model is practical at all for two big reasons.

His reasons involve not having a business case where an entire application is right there for the user to download and that its an insecure method for running an app.

0 comments voice your opinion now!
json mysql stored procedure call json application json mysql stored procedure call json application


Jan Lehnardt's Blog:
CouchDb PHP Library for JSON API
September 10, 2007 @ 11:10:00

Jan Lehnardt points out an update that's been made to the CouchDb PHP library for the JSON API. As posted to the mailing list for the project:

Dear Couch Potatoes (or something), I updated the CouchDb PHP Library and the Demo application BugShrink (our bug-tracker) to the new JSON API.

You can try out this new update via the project's repository or just check out the CouchDb project homepage for more information.

0 comments voice your opinion now!
couchdb project update library json api database erlang couchdb project update library json api database erlang



Community Events











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


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

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