I want to remove the last ' AND' from my string im using to build a mySQL query. I thought using rtrim was the way to go but either im wrong or im not using it correctly:
foreach ($dupArray as $k => $v) { $whereStr = $whereStr . "$k='$v' AND "; } rtrim($whereStr, "AND"); echo $whereStr;
Anyone got any ideas? I swear ive seen this done else where but i cant find any examples