I want to slice the last bit of a string until a marker
$sql = substr($sql,0,(strlen($sql)-(strlen(strrchr($sql,',')))));
this seems to work but I think there is a better way that I don't know of...
anybody know one?
<? $sql=substr($sql,0,strrpos($sql,',')); ?>
strrpos finds the las occurence of a string in a string as aposed to strpos which finds the first. HTH Rob
thnx that's what I was looking for 🙂