Friday, May 21, 2010

How to remove excess whitespaces from a string?



I was looking for a small and quick way to remove excess whitespaces from a string. Sometimes you get SQL statement (or any other string) with whitespaces and need to clean it before your function starts to work with it.

For example:
$sql = "SELECT 
id, field1, field2 ....
FROM table
WHERE status = 1";

And after trying some ways we found, that using preg_replace() function is the best one.

Here the pimpliest way how to do this:
$sql = preg_replace('/\s\s+/', ' ', $sql);


Monday, May 17, 2010

New version 6.0.8 of PHP DataGrid released

The new version 6.0.8 of PHP DataGrid is available now for downloading. There are many improvements and new features, like caching, drawing horizontal "barchart" fields, file extension icons etc. This version requires full re-installation, if you work with one of previous. Read carefully Getting Started.


Here the main additions and improvements:


* Feature: [added] possibility to show count of filter values in dropdown lists: "show_count"=>true
* Feature: [added] non-documented property initFilteringState = "closed|opened (default)"
* Feature: [added] caching feature for View mode

* Feature: [improved] removed `` from tables and fields names
* Feature: [improved] "checkbox" field in view mode: added attribute "readonly"=>"true|false"
* Feature: [improved] drawing horizontal "barchart" fields
* Feature: [improved] alignment for "money" fields
* Feature: [improved] "date_format" attribute for calendar filtering fields: added new type - datemdy (month-day-year)
* Feature: [improved] added file extension icon for uploaded files in add/edit/details modes

* Many bugs fixed

To view a Live Demo click here.

To download new version click here.

Wednesday, May 05, 2010

ApPHP Shopping Cart - New Product Release


We are happy to announce that new product ApPHP Shopping Cart Advanced was released and available now for downloading from the site.

A Short List of Features:

* Virtual multiple product shopping cart
* Multi-Language
* Multi-Currency
* Orders management and history
* Integrated PayPal module
* Admins/Customers management
* News module
* Gallery module
* Contact Us module
* Comments module
* Powerful Administrator Control Panel
* CMS for pages with WYSIWYG
* Customers registration and login

LIVE DEMO can be viewed here:
http://www.apphp.com/php-shopping-cart/examples/sample2/index.php