Improvement of a regular expression pattern I created this script to take informations "at-the-moment" of this site:

Pictures of name channel
Name of channel
Pictures channel
Times
Title
Type


My script (Work):

&lt;?php

$url="http://www.programme-tv.net/programme/toutes-les-chaines/en-ce-moment.html#Grandes%20cha%C3%AEnes";
$code_page = file_get_contents($url);

preg_match_all('/&lt;div class="channelItem"&gt;(.*?)&lt;img src="(.*?)" alt="Le programme de (.*?)" width="70" height="30"&gt;/is', $code_page, $chaines);
preg_match_all('/&lt;div class="show (.*?) at-the-moment current (.*?)"&gt;(.*?)&lt;div class="show-infos"&gt;(.*?)&lt;\/div&gt;/is', $code_page, $channels);

$i=0;
foreach ($channels as $channel) {
    if($i==3){
        for ($j=0; $j &lt; 38; $j++) {
            preg_match_all('/&lt;span class="(.*?)"&gt;&lt;img src="http:\/\/static.programme-tv.net\/var\/epgs\/169\/80x\/(.*?)" alt="(.*?)" width="80" \/&gt;&lt;\/span&gt;/', $channel[$j], $image[$j]); 
        }
    }

if($i==4){
        for ($j=0; $j &lt; 38; $j++) { 
            preg_match_all('/&lt;p class="time"&gt;(.*?)&lt;\/p&gt;/', $channel[$j], $time[$j]);
            preg_match_all('/&lt;p class="title"&gt;(.*?)&lt;\/p&gt;/', $channel[$j], $title[$j]);
            preg_match_all('/&lt;p class="type"&gt;(.*?)&lt;\/p&gt;/', $channel[$j], $type[$j]);
        }
    }
    $i++;
}

for ($i=0; $i &lt; 38; $i++) {
    $test = strpos($chaines[2][$i],' &lt;/div&gt;');
    if($test != true){
        echo 'Chaines images: &lt;img src="'.$chaines[2][$i].'"/&gt;&lt;br /&gt;';
        echo 'Chaines: '.$chaines[3][$i].'&lt;br /&gt;';
        echo 'image : &lt;img src="http://static.programme-tv.net/var/epgs/169/80x/'.$image[$i][2][0].'" /&gt;&lt;br /&gt;'; 
        echo 'Temps : '.trim($time[$i][1][0]).'&lt;br /&gt;';
        echo 'Titre : '.substr($title[$i][1][0], strpos($title[$i][1][0], '&gt;') + 1, strrpos($title[$i][1][0], '&lt;')).'&lt;br /&gt;';
        echo 'Type : '.$type[$i][1][0].'&lt;br /&gt;';
        echo '&lt;hr&gt;';
    }
}
?&gt;


I would like to improve and find a better regular expression pattern because I use 6 regular expression pattern.
To be honest I don't think your current way of handling is 'clean'.
But I would suggest you to use a HTML DOM parser. I took the liberty to google it for you and http://simplehtmldom.sourceforge.net/ seems quite what you need.

It's a PHP HTML parser, which allows you to write

// Find all element which class=foo
$ret = $html-&gt;find('.at-the-moment');


instead of 

preg_match_all('/&lt;div class="show (.*?) at-the-moment current (.*?)"&gt;(.*?)&lt;div class="show-infos"&gt;(.*?)&lt;\/div&gt;/is', $code_page, $channels);


Also your other regexes can be switched (read the documentation)

To be honest, I never used this library before, but I've worked with beautifulsoup which is a Python equivalent, which would do the trick for you perfectly.
(source: http://www.givegoodweb.com/post/210/html-parser-for-php)

Wishing you the best!