Image

Imagesourpatchkid wrote in Imagephp

What I am doing is taking a query string that calls a MySQL query. I use this function to pad the title from the row in the table to pass to a file which creates a png(via GD). It has to be image.php?text=foo+bar because image.php?text=foo bar does not parse(duh).

My function works, but is there a better way to do this?

function imgText($str){
     $arr = explode(" ", $str);
     $count = count($arr);
     $text = '';
     for($i = 0; $i < $count; $i++){
          $text .= "".$arr[$i]."+";
     }
     return substr($text, 0, -1);
}