News Feed
Sections
News Archive


Community Events
php|tek 2008 PHP Conference



feed this:

Developer Tutorials Blog:
PHP array_walk() Run an array through a function
0 comments :: posted Wednesday April 23, 2008 @ 08:47:09
voice your opinion now!

The Developer Tutorials blog has a quick example of how to use the array_walk function to maneuver through the array of your choosing and applying a callback method to each of its elements.

It’s a common sight: taking an array and running (well, walking) its elements through a particular function. Luckily, PHP provides a simple yet powerful function to overcome this: array_walk().

They include an example, giving a sample "some_function" the array_walk method uses when it's called, replacing a foreach (or other type of loop). Plus you can specify an object with the callback to run it against a method inside a class too.

tagged with: arraywalk function callback object method loop tutorial


DevShed:
Defining a Custom Function for File Uploaders with PHP 5
0 comments :: posted Wednesday April 09, 2008 @ 09:48:48
voice your opinion now!

On DevShed today, there's a new article in their series looking at creating custom functions to handle file uploads in your application:

I'm going to show you how to wrap the file uploading application built in the previous article of the series into a single custom PHP function. This will turn it into a more maintainable and reusable piece of code.

They review the source built in previous parts of the series and show how to update it with a uploadFile() function that takes all of the logic from before (exceptions and all) and wraps it up into a nice little package that can be reused anywhere.

tagged with: php5 file upload custom function tutorial

Eirik Hoem's Blog:
Dying with grace - PHP's register_shutdown_function
0 comments :: posted Monday March 17, 2008 @ 12:02:00
voice your opinion now!

Eirik Hoem has posted a new look at a function that can be amazingly helpful when you have a script with issues that needs a little extra help cleaning up after itself - register_shutdown_function.

Scripts tend to die, and that's not usually nice. We do not want to show the user a fatal error nor a blank page (display errors off) . PHP has a function called register_shutdown_function which lets us set up a function which is called at execution shutdown. What this means is that our function will be executed when our script is done executing / dying and PHP execution is about to shut down.

He suggests various things that can be done with the functionality, including checking for successful script execution (via a false variable that can be checked for success).

tagged with: registershutdownfunction shutdown function register die success

Developer Tutorials Blog:
Calculating date difference more precisely in PHP
0 comments :: posted Tuesday March 11, 2008 @ 08:40:00
voice your opinion now!

Hasin Hayder has posted his own response to a recent "relative time" article (showing users things like "received 2 days and 3 hours ago") with a more precise method for doing something similar:

This function is production ready and you can use it in any of your application which mainly works with these date difference. I have found it somewhere in web, just forgot the source. Thanks to the unknown author of this excellent function.

The rest of the post is the function itself that takes in the interval string (formatting), the start date, end date and whether to use timestamps or not.

tagged with: date calculate precise difference timestamp function

Community News:
Zipline Interactive Updates PHP Function Finder (Windows Gadget)
0 comments :: posted Friday February 15, 2008 @ 12:59:00
voice your opinion now!

Ryan from Zipline Interactive submitted an update about the latest version of their "Function Finder" they've created for Windows (and is mentioned here):

Zipline Interactive has released the second version of their free PHP Function Finder Gadget for Windows Vista. The tool can be downloaded directly from the Zipline Interactive website at: http://www.gozipline.com/23,phpfunctionfindergadget. You can also download the latest version by going to the PHP.net website sidebar page located at: http://www.php.net/sidebars.

This new version is quite a bit smaller (physically) than its predecessors and is rectangular so it fits a bit better alongside other gadgets. They also fixed a bug that was causing a blink to happen when the search was performed.

Grab this latest download here.

tagged with: zipline interactive function finder gadget windowsvista

DevShed:
Defining Some Custom PHP Functions with Yahoo Web Services
0 comments :: posted Tuesday February 05, 2008 @ 11:18:00
voice your opinion now!

DevShed continues their series looking at connecting a PHP5 script to the powerful Yahoo! search backend with part four of the series today. This part focuses on reworking some of the previous examples to make them more modular using custom defined functions.

Logically, these examples can be really useful for learning the basic concepts surrounding the use of these search services, but undoubtedly, it's necessary to modify and improve their source code to make it more compact and completely reusable.

They start the overhaul with the web search (complete with example results) then push on to the video and image searches and work them over the same way.

tagged with: webservice yahoo tutorial php5 search video image function

Phil Thompson's Blog:
7 PHP functions that saved my life
0 comments :: posted Tuesday January 22, 2008 @ 11:08:00
voice your opinion now!

On his blog, Phil Thompson lists seven PHP functions that "saved his life" when developing his apps:

From time to time, I've struggled with minor pieces of coding for what seems like an age and then I've discovered PHP has a ready-made function whose express purpose seems to be to fix my exact problem. Today, I name and honour those PHP functions which saved my life, my career and my sanity.

Functions that made the cut include:

He has his own reasons for each - all of them being handy little functions that fill a specific niche in PHP's vast array of abilities.

tagged with: handy function numberformat arrayvalues isset arraydiff

Kevin van Zonneveld's Blog:
Porting PHP to Javascript
0 comments :: posted Tuesday January 08, 2008 @ 08:47:00
voice your opinion now!

The Zend Developer Zone has pointed out several code snippets from Kevin van Zonneveld that are ports of some favorites from the world of PHP over to Javascript.

They're broken up into a series of posts to his blog and include:

Each post includes a description, the parameters the function takes in, return values, credits for the code and the Javascript code to make it work. For a library with the complete list of ported functions, you can download this .js file (or the compressed version).

You can check out the full list of ported functions in this category on his blog.

tagged with: port javascript function library download port javascript function library download


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

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