You are trying to manipulate a hyperlink to pass an extra parameter through a URL. You must do this in the client with Javascript.
Here is an example from phpGrid that calls the javascript function when the user clicks a hyperlink in the grid. Here is the link:
http://phpgrid.com/example/call-javascript-function-on-hyperlink-click/
(http://phpgrid.com/documentation/enable_rownumbers/)
PHP
$dg->set_col_format("productLine", "showlink", array("baseLinkUrl"=>"javascript:", "target"=>"_self",
"showAction"=>"myFunction(jQuery('#products'),'",
"addParam"=>"');"));
Javascript
myFunction = function (grid,param) {
var ar = param.split('=');
if (grid.length > 0 && ar.length === 2 && ar[0] === '?id') {
var rowid = ar[1];
var kbid = grid.getCell(rowid, 'kbid');
var rowNum = grid.getInd(rowid);
window.location.href = "http://example.com/?offset="+ rowNum +"&kbid="+kbid;
}
};
getInd , : http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods