Jump to content

Disable current age link with preg_replace()


darkminos

Recommended Posts

Hi,

 

I have a code to create multiple pages for an array and want to remove the link from the current page so that if you on page 5, the number 5 will be just text, can someone help please. I think it should include the code below, however I'm not sure how to implement it in a for() loop.

 

preg_replace("/\<a(.*)\>(.*)\<\/a\>/iU", "", $links_code);

 

for ($n=0; $n<$max_items; $n++) { 

				"<a href='?".
	         'language'           .'='.$language                      .'&'.
	         'locale'             .'='.$locale                        .'&'.
	         'page'               .'='.($n + 1)		                  .'&'.
	         'searchindex'        .'='.$searchindex                   .'&'.
	         'searchparameter'    .'='.$searchparameter               .'&'.
	         'searchparameterdata'.'='.urlencode($searchparameterdata).'&'.
	         'search_items'       .'='.$query					            .'&'.
	         'search_dropdown'    .'='.$_GET['search_dropdown']       .'&'.
	         'start_at'   			.'='.(($n * $results_per_page))	.'&'.         
	         "'>".($n + 1)."</a> | \n";

} 

echo $links_code; 	

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.