Php is stripping one letter "g" from my rtrim function but not other chars

Posted by Chase on Stack Overflow See other posts from Stack Overflow or by Chase
Published on 2010-06-11T02:33:13Z Indexed on 2010/06/11 2:42 UTC
Read the original article Hit count: 292

Filed under:
|
|
|

I'm trying to trim some youtube URLs that I am reading in from a playlist. The first 3 work fine and all their URLs either end in caps or numbers but this one that ends in a lower case g is getting trimmed one character shorter than the rest.

for ($z=0; $z <= 3; $z++)

{ $ythref2 = rtrim($tubeArray["feed"]["entry"][$z]["link"][0]["href"], '&feature=youtube_gdata');

The URL is http://www.youtube.com/watch?v=CuE88oVCVjg&feature=youtube_gdata .. and it should get trimmed down to .. http://www.youtube.com/watch?v=CuE88oVCVjg but instead it is coming out as http://www.youtube.com/watch?v=CuE88oVCVj.

I think it may be the ampersand symbol but I am not sure.

© Stack Overflow or respective owner

Related posts about php

Related posts about php5