PHP scripts and programs for Beginner to Master php programs, php ready to use scripts & functions, css tutorials, html, javascripts, ajax examples for Beginner to Master
Jumat, 21 Mei 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
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar