Jump to content

clearstatcache

Members
  • Posts

    159
  • Joined

  • Last visited

    Never

Posts posted by clearstatcache

  1. try this...

     

    $line =  "<Link> I WANT TO EXTRACT THIS 3 </Link>";

    if (preg_match("/\<Link\>/", $line)) {

    $clean = preg_replace("/(\<Link\>)|(\[b\])|(\[\/b\])|(\<\/Link\>)/", "", $line);

    }

    print "$line\n";

    print "$clean\n";

     

  2. this works in me....

     

    <?php

     

    $location = array(

    'uk' => 'United Kingdom',

    'af' => 'Afghanistan',

    'al' => 'Albania',

    'dz' => 'Algeria',

    'as' => 'American Samoa',

    'ad' => 'Andorra',

    'ao' => 'Angola',

    'ai' => 'Anguilla',

    'aq' => 'Antarctica',

    'ag' => 'Antigua And Barbuda',

    'ar' => 'Argentina',

    'am' => 'Armenia',

    'aw' => 'Aruba',

    'au' => 'Australia',

    'at' => 'Austria',

    'aw' => 'Aruba',

    'ax' => 'Aland Islands'

    );

     

    $result_nation = 'ar';

     

    echo "<select class=\"forminput\" name=\"result_nation\">";

    foreach ($location as $key => $value) {

     

    echo "<option value=\"$key\"";

     

    if ($key==$result_nation) { echo " selected"; }

     

    echo ">$value</option>\n";

    }

    echo "</select>";

    ?>

     

     

  3.  

     

    <?php

    $a = mysql_query("

                select q1.reply

                from (

                        select reply, count(*) as data_cnt from sample where 1 group by reply

                      ) as q1

              left join (

                        select reply, count(*) as check_cnt from sample where `check`=1 group by reply

              ) as q2

                      on q1.reply=q2.reply

              where data_cnt = check_cnt

          ");

    while($b = mysql_fetch_assoc($a))

    {

    mysql_query("DELETE FROM `table` WHERE `reply` = '$b[reply]'");

    }

    ?>

  4. try this one......

     

    <?php

     

    function bximagecrawl($name) {

        $url = "http://images.google.com/images?hl=en&q=$name&btnG=BX&gbv=2";

        $user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";

        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, $url);

        curl_setopt($ch, CURLOPT_FAILONERROR, 1);

        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

        curl_setopt($ch, CURLOPT_PORT, 80);

        curl_setopt($ch, CURLOPT_TIMEOUT, 5);

        curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);

        $document = curl_exec($ch);

        $images = array();

        $images = explode('img src=http://', $document);

        array_shift($images);

        foreach($images as $key => $value) {

            $tokens = preg_split('/\>|\"| /', $value);

            $images[$key] = "http://".$tokens[0];

        }

        return $images;

    }

    $name = 'danielradcliff';

    $images = bximagecrawl($name);

    print_r($images);

     

    ?>

     

  5. not sure wd this.....hehehe

     

    <?php

     

    function bximagecrawl($name) {

        $url = "http://images.google.com/images?hl=en&q=$name&btnG=BX&gbv=2";

        $user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";

        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, $url);

        curl_setopt($ch, CURLOPT_FAILONERROR, 1);

        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

        curl_setopt($ch, CURLOPT_PORT, 80);

        curl_setopt($ch, CURLOPT_TIMEOUT, 5);

        curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);

        $document = curl_exec($ch);

        $images = array();

        $images = explode('href="http://', $document);

        array_shift($images);

        foreach($images as $key => $value) {

            $tokens = preg_split('/\>|\"| /', $value);

            $images[$key] = "http://".$tokens[0];

        }

        return $images;

    }

    $name = 'danielradcliff';

    $images = bximagecrawl($name);

    print_r($images);

     

    ?>

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.