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)
Menampilkan Gambar Secara Acak dengan PHP
untuk membuat website tampak lebih dinamis maka tampilan pada website tersebut lebih baik dpat berubah sewaktu – waktu, salah satu trik untuk membuat website anda tampak dinamis adalah menampilkan gambar yang berubah – ubah, berikut ini script untuk dapat menampilkan gambar secara acak $file_array = array (‘http://www.earlyedition.info/me/footer/footer_home.gif’, ‘http://www.earlyedition.info/me/footer/footer_mit.gif’, ‘http://www.earlyedition.info/me/footer/footer_music.gif’, ‘http://www.earlyedition.info/me/footer/footer_music2.gif’, ‘http://www.earlyedition.info/me/footer/footer_tv.gif’, ‘http://www.earlyedition.info/me/footer/footer_orange.gif’, ‘http://www.earlyedition.info/me/footer/footer_game.gif’); $total = [...]
25.Sep.08
PHP
Comments (2)