PHP Quick Question

Discussion in 'PHP' started by Dreads, May 8, 2008.

  1. #1
    Well the best way to help explain is by giving you first the example
    http://g4hq.com/rssbasic.php

    The php code
    <?php
    $youtube = "http://s1.ytimg.com/vi/";
    $link = "[youtube]";
    $youtubex = "/default.jpg";
    $linkx = "[/youtube]";
    $larry = "http://youtube.com/rss/global/top_viewed_today.rss";
    $fp = file_get_contents($larry);
    $newfp = str_replace($youtube, $link, $fp);
    $nex = str_replace($youtubex, $linkx, $newfp);
    $flex = trim($nex,"&lt;img");
    echo "$flex";
    ?>
    PHP:
    Now
    View the source on that page above .. and the problem is i get this ->
    I want to remove the <img src=" and possibly the align="right".../> Parts
    so it would be [youtube]XXXXX[/youtube]

    How would i go upon doing so? I tried to trim <img src.. and that didnt work -_-



    I want it so that it is removes <img src="[youtube]lklfIPBK4Zg[/youtube]" align="right" border="0" width="120" height="90" vspace="4" hspace="4" />
     
    Dreads, May 8, 2008 IP
  2. CPURules

    CPURules Peon

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think something may be wrong anyway. The first item is shown as <img src="[youtube]blah[/youtube]">

    Here's what the others look like;
    <img src="http://s3.ytimg.com/vi/jdzCxvbe5Hg[/youtube]

    If you fix this I can do this easily
     
    CPURules, May 8, 2008 IP
  3. Dreads

    Dreads Well-Known Member

    Messages:
    1,884
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    150
    #3
    well yeah i can fix that
    tho how would i remove the <img src ?
     
    Dreads, May 8, 2008 IP
  4. CPURules

    CPURules Peon

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I fixed the part aforementioned, am working on removing the img src right now.
     
    CPURules, May 8, 2008 IP
  5. Dreads

    Dreads Well-Known Member

    Messages:
    1,884
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    150
    #5
    ight thanks
     
    Dreads, May 8, 2008 IP