Signs for Regular Expresions

^ Start of line $ End of line n? Zero or only one single occurrence of character ‘n’ n* Zero or more occurrences of character ‘n’ n+ At least one or more occurrences of character ‘n’ n{2} Exactly two occurrences of ‘n’ n{2,} At least 2 or more occurrences of ‘n’ n{2,4} From 2 to [...]

Tags:

11.Oct.08 PHP, Programming Comment (1)

Catch keywords from Google with PHP script

Try this for catch keywords at your web function get_search_phrase($referer){ $key_start = 0; $search_phrase = “”; // used by google, msn, alta vista, ask jeeves, all the web, teoma, wisenut, search.com if (strpos($referer, ‘q=’) !== false) $key_start = strpos($referer, ‘q=’) + 2; // if present, get the search phrase from the referer if ($key_start > [...]

Tags: , ,

03.Oct.08 PHP Comment (1)

Metacharacters in Regular Expresions

ereg_replace To delete all signs / symbols from a string, you can use the function with special values: ereg_replace(”[[:punct:]]”,”,$string); The following is a set of special values that denote certain common ranges. They have the advantage that also take in account the ‘locale’ i.e. any variant of the local language/coding system. [:digit:] Only the digits [...]

Tags: ,

29.Sep.08 PHP Comments (0)

Jangan Gunakan Regular Expressions Kecuali Memang Harus

Fitur php sangatlah banyak, beberapa memang sangat powerful. Namun, pada situasi tertentu 2 atau lebih function dapat digunakan untuk mengatasi masalah yang sama, namun dengan perbedaaan performance. Mungkin yang paling sering digunakan adalah ereg_replace dan preg_replace. Bila hanya ingin mengganti string, cukup gunakan str_replace karena dengan regular expression di atas akan memakan waktu 10 kali [...]

Tags: , ,

27.Sep.08 PHP Comments (0)

Multiple (Multi-dimensional) Array in NuSoap

NuSoap – WSDL untuk data array, bagaimana caranya? mengirim variabel output array kepada aplikasi client. syntax xsd:array tidak ada. Ini contoh aplikasi sederhana untuk menampilkan data mahasiswa dari suatu jurusan. perhatikan tipe data ini : // registers the types || Register the data structures used by the service // Input Complex Datatype $server->wsdl->addComplexType ( ‘TypeDataInput’, [...]

Tags: , ,

25.Sep.08 PHP, Web Service Comment (1)

:)