php regex

Quiero hacer un script php que tome solo urls de todas las ofertas de trabajo(De una pagina web) y las muestre en un array por pantalla.Tengo este script pero esto muestra todos los urls de la pagina web??
[php]<?php

function urlLooper($url){

    $urlArray = array();

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $result = curl_exec($ch);

    $regex='|<a.*?href="(.*?)"|';
    preg_match_all($regex,$result,$parts);
    $links=$parts[1];
    foreach($links as $link){
        array_push($urlArray, $link);
    }
    curl_close($ch);

    foreach($urlArray as $value){
        echo $value . '<br />';
    }
}

$url = 'http://sitio';
urlLooper($url);

?>
[/php]
Porfavor alguien puede ayudar!!!

Please write in english so as many users as possible are able to answer :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service