Php Pager question


I am using the pager class (from pear) in PHP. I am not sure if I am using it right, but I downloaded some code from Internet where I can include a pager class and call the pager function..
This is how I am calling the Pager function in my php page…

 $pager_options = array(
        'mode'       => 'Sliding',
        'append'    => false,
        'perPage'    => 30,
        'delta'      => 4,
        'fileName'  => '/temp-%d.htm',
        'currentPage' => $pagenum,        
        'totalItems' => $rows,
        'curPageLinkClassName' => 'active',
        'separator' => '',
        'nextImg' => '<strong>Next</strong> &raquo;',
        'prevImg' => '&laquo; <strong>Previous</strong>',
        'spacesBeforeSeparator' => 0,
        'spacesAfterSeparator' => 0,
        'clearIfVoid' => true
        $pager = Pager::factory($pager_options);
        echo '<div align="center" id="pagination">' .  $pager->links . '</div>';

Now, it works fine, but my problem is, for the first page the link would be temp-1.htm, but I want it as temp.htm or temp/index.htm… For other pages, temp-2.htm, temp-3.htm is fine..

Is there any work around? Thanks in advance…

Best Solution

echo '<div align="center" id="pagination">',
     str_replace('temp-1.htm', 'temp.htm', (string) $pager->links),