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: Regular Expresions
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 > [...]
03.Oct.08
PHP
Comment (1)
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: optimasi, performance, regular expression
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’, [...]
25.Sep.08
PHP, Web Service
Comment (1)