$img= mysql_real_escape_string(end(explode('/',$_POST['img'])));
the statement expects a variable to be passed, any idea on how to use both the end and explode functions?
the statement expects a variable to be passed
so why don't you pass it a variable reference to the end
function ?
$images = explode('/',$_POST['img']);
$lastImage = end($images);
$img = mysql_real_escape_string($lastImage);