Hi there. I don't want the comma for the very last record. How can I state this in the loop below???? while($emailline= mysql_fetch_array($getemailresult, MYSQL_ASSOC)){ $sendTo.="$emailline[email],"; }
well, you can do that in the loop, or just do:
while($emailline= mysql_fetch_array($getemailresult, MYSQL_ASSOC)){ $sendTo.="$emailline[email],"; } $sendto=substr($sendto,0,-1);
maybe not the most elegant solution, but it should work...๐
Hi there. I was looking for more of a reg exp to test the last charactor for a comma. I stink at reg exp so I thought maybe someone could show me the way. Tracy๐
what about this:
if(substr($sendTo, -1, 1)==","){yadda}