i want to cut an extra comma off the end of a returned string so i have this, but it's not working. what am i doing wrong? thanks.

$one = "one, ";
$two = "two, ";
$three = "three, ";

$whatever = $one . $two . $three;
$whatever = rtrim($whatever, ",");

    Your strings all have spaces and commas after them, so you could either do rtrim with no parameters first, then with a comma as a parameter, or change the parameter list to ", " with a space as well as a comma

      Write a Reply...