background preloader

PHP

Facebook Twitter

PHPExcel. PHPPowerPoint. PHPWord. PHPLinq - LINQ for PHP - Language Integrated Query. Examples can be found in the test package in the latest release. A basic example Let's say we have an array of strings and want to select only the strings whose length is < 5. The PHPLinq way of achieving this would be the following: // Create data source $names = array("John", "Peter", "Joe", "Patrick", "Donald", "Eric"); $result = from('$name')->in($names) ->where('$name => strlen($name) < 5') ->select('$name'); Feels familiar to SQL?

You may have noticed something strange... An advanced example There are lots of other examples available in the PHPLinq download, but here's an advanced one... First of all, let's define our data source: Now for the PHPLinq query: $result = from('$employee')->in($employees) ->where('$employee => strlen($employee->Name) == 4') ->orderBy('$employee => $employee->Name') ->thenByDescending('$employee => $employee->Age') ->select('new { "EmailAddress" => $employee->Email, "Domain" => substr($employee->Email, strpos($employee->Email, "@") + 1) }'); 30 Useful PHP Classes and Components « PHP::Impact ( [str blog] Simplicity and extensibility are the main reasons why PHP became the favourite dynamic language of the Web.

In the last decade, PHP has developed from a niche language for adding dynamic functionality to small websites to a powerful tool making strong inroads into large-scale Web systems. Below I present 30 useful PHP classes and components that you can use to test, develop, debug and deploy your PHP applications. Let me know if I missed anything or if you have something to add. Database Creole Creole is a database abstraction layer for PHP5. LINQ for PHP LINQ is a component that adds native data querying capabilities to PHP using a syntax reminiscent of SQL.

ADOdb ADOdb Database Abstraction Library for PHP. Propel Propel is an Object-Relational Mapping (ORM) framework for PHP5. Doctrine Doctrine is a tool for object-relational mapping in PHP. PHPillow PHPillow is an object orientated wrapper for CouchDB. Development phpDocumentor HTML Purifier PHP CodeSniffer GeSHi Unit Testing PHPUnit SimpleTest dBug.

PHP Code Snippets. PEAR :: The PHP Extension and Application Repository. Framework: Documentation. The YouTube Data API offers read and write access to YouTube's content. Users can perform unauthenticated requests to Google Data feeds to retrieve feeds of popular videos, comments, public information about YouTube user profiles, user playlists, favorites, subscriptions and so on. For more information on the YouTube Data API, please refer to the official » PHP Developer's Guide on code.google.com. Authentication The YouTube Data API allows read-only access to public data, which does not require authentication. For any write requests, a user needs to authenticate either using ClientLogin or AuthSub authentication. Developer Keys and Client ID A developer key identifies the YouTube developer that is submitting an API request.

Example #1 Passing a Developer Key and ClientID to Zend_Gdata_YouTube $yt = new Zend_Gdata_YouTube($httpClient, $applicationId, $clientId, $developerKey); Retrieving public video feeds Searching for videos by metadata Example #2 Searching for videos Browser-based upload. Zend Framework.