Size: 731260928 bytes (697.38 MiB), duration: 01:49:36, avg.bitrate: 890 kb/s above line i want only "697.38" and "01:49:36" in php ..... i just try out but little help required me :Thanks like 697.38 01:49:36
try this <?php $src_str = 'Size: 731260928 bytes (697.38 MiB), duration: 01:49:36, avg.bitrate: 890 kb/s'; $size = get_string('(', ' MiB)', $src_str); $duration = get_string('duration: ', ', avg', $src_str); echo $size.' | '.$duration; function get_string($start, $end, $src) { $begin = strpos($src, $start)+strlen($start); $last = strpos($src, $end); return substr($src, $begin,$last-$begin); } ?> PHP:
$src_str = 'Size: 731260928 bytes (697.38 MiB), duration: 01:49:36, avg.bitrate: 890 kb/s'; preg_match('/.*bytes \(([0-9.]+) MiB.*([0-9]{2}:[0-9]{2}:[0-9]{2}),.*/',$src_str,$result); print_r($result); PHP: This should work nicely.
Both are ThePHPMaster. and ZoomRumble solution are good ... but ThePHPMaster is more professional way. For understanding this code you should have knowledge of RegEx(i am also learn this because regEx is most important and it is future ) ZoomRumble code is very simple and shown me the importance of Function ... I am very thank full these two person who come in and write the code and show me the two way of solution