lemonade
where dream meets reality
Categories: php | Add a Comment

Pengen download video dari youtube? ngapain susah. nih gue kasih demo nya buat elo2 pada pake php. DEMO dan download script dapat dilihat di sini. <?php /* * youtube url downloader v0.2 – after youtube upgrade 29 agustus 2009 * * by lemonade <firman@maxindo.net> * donation is very appreciated, paypal: cool01@indosat.net.id * * * ChangeLog * * v0.2 * 27/10/2009 – new parsing for youtube. * * v0.1 * 25/09/2009 – small fix for FLV url. * */ if(!empty($_REQUEST[‘yid’])) { $yid = trim($_REQUEST[‘yid’]); $yid = urldecode(rawurldecode($yid)); if (preg_match(‘%http://www.youtube.com/watch?v=(.*)%s’, $yid, $regs)) { […]

Categories: php | 1 Comment

Contoh client-server chatting (single client) menggunakan PHP socket. Server.php <?php //The Server error_reporting(E_ALL); $address = “127.0.0.1”; $port = “10000”; /* create a socket in the AF_INET family, using SOCK_STREAM for TCP connection */ $mysock = socket_create(AF_INET, SOCK_STREAM, 0); // if socket is uses, we reuse it if (!socket_set_option($mysock, SOL_SOCKET, SO_REUSEADDR, 1)) { echo socket_strerror(socket_last_error($mysock)); exit; […]