I have a sample code:
$filename = 'http://thebox.vn/Uploaded/catmy/2013_04_23/couple_t2.jpg?maxwidth=480';
And I using this code to remove variable (maxwidth)
echo preg_replace('/(\?)$/', '', $filename)
=> How to remove variable (maxwidth), how to fix it ?