Archives
You can parse a tags (links) using this function. I have published loading remote file content function in previous post. Using the functions together you can crawl links of websites.
The function will return content of given URL.
Javascript code (jQUERY):
Do you know what will happen tomorrow? If no then always backup your data…… Here’s some command lines about backing up databases via mysqldump.
function mbmGetFLVDuration($file){ /* * Determine video duration with ffmpeg * ffmpeg should be installed on your server. */ //$time = 00:00:00.000 format $time = exec(“ffmpeg -i “.$file.” 2>&1 | grep “Duration” | cut -d ‘ ‘ -f 4 | sed s/,//”); $duration = explode(“:”,$time); $duration_in_seconds = $duration[0]*3600 + $duration[1]*60+ round($duration[2]); return $duration_in_seconds; } Usage: $duration [...]
Ftp_put() php function with example.
Converting standart IP format to long IP format.
memcached is very useful memory caching system that saves high server loads. I’ll show here step by step about installing memcached on centos. I have installed it CentOS 5.3 x64 with cPanel server and saved what i did as following content.
function mbmDownloadWithCURL($fileURL=”,$saveFile=”){ $fp = fopen ($saveFile, ‘w+’);//This is the file where we save the information //$ch = curl_init(‘http://www.yadii.net/files/videos/1244703817-saraa.flv’);//Here is the file we are downloading $ch = curl_init($fileURL);//Here is the file we are downloading curl_setopt($ch, CURLOPT_TIMEOUT, 50); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_exec($ch); curl_close($ch); fclose($fp); } Usage: mbmDownloadWithCURL(‘http://www.domain.com/file.zip’,'/home/username/public_html/foldername/filesaved.zip’);