SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 28 of 28
  1. #26
    SitePoint Addict aniltc's Avatar
    Join Date
    Nov 2006
    Location
    INDIA
    Posts
    399
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have come up with a solution like this but it fails in one particular video

    $u = $paths_youtube;
    $m=preg_split('/width=/',$u);
    echo $org_w = substr($m[1],0,5);
    echo "<br/>";
    echo $org_h = substr($m[1],13,5);


    $u = str_replace('width='.$org_w, 'width="260"', $u);
    $u = str_replace('height='.$org_h, 'height="207"', $u);

    echo $u;

  2. #27
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,684
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Here's another dosing of regular expressions.

    $youTube = preg_replace('/width="(\d+)"/', '260', $youTube);
    $youTube = preg_replace('/height="(\d+)"/', '207', $youTube);
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #28
    SitePoint Addict aniltc's Avatar
    Join Date
    Nov 2006
    Location
    INDIA
    Posts
    399
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks to all


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •