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. Zend Framework.