Jump to content

One line I just am having a ton of problems with...


cowboysdude

Recommended Posts

Honestly I've been staring at this for 3 hours LOL and I just can't get it to work..  A little help please would be so awesome.

 

$link = '<a rel="lightbox[social]" title="DCC Videos" href="echo (str_replace("&feature=youtube_gdata","", $video['link']))">';

 

To be more precise this is actually the part that's not working...

 

href="echo (str_replace("&feature=youtube_gdata","", $video['link']))">';

 

That line right there is my problem... whew... thrown myself a little I think...

 

Thank you for the help!

Can always break it down and make it easier on yourself

 

<?php
$test_link = "http://www.youtube.com/watch?v=LkjE6FMoBwQ&feature=youtube_gdata";
$new_link = str_replace("&feature=youtube_gdata",'',$test_link);
echo "<a href='$new_link'>$new_link</a>";
?>

 

$link = '<a rel="lightbox[social]" title="DCC Videos" href="'. (str_replace("&feature=youtube_gdata","", $video['link'])).'">';

 

THANK YOU!!  I will look at it again when my eyes are rested.. but it worked!!!  Thank you very much!

Can always break it down and make it easier on yourself

 

<?php
$test_link = "http://www.youtube.com/watch?v=LkjE6FMoBwQ&feature=youtube_gdata";
$new_link = str_replace("&feature=youtube_gdata",'',$test_link);
echo "<a href='$new_link'>$new_link</a>";
?>

 

 

Thank you too!! That would have also worked I believe!!  You guys rock...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.