but, in both cases it should work fine, the point is to include the ? in the segment.
If you want to generate only the second version of the links through an array, then this could be done by extending the url helper, for example by simply exploding the string at the ? character and removing the right slash. In application/helpers create the file MY_url_helper.php and paste this: