darkminos Posted June 26, 2012 Share Posted June 26, 2012 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; Quote Link to comment https://forums.phpfreaks.com/topic/264783-disable-current-age-link-with-preg_replace/ Share on other sites More sharing options...
zPlus Posted June 26, 2012 Share Posted June 26, 2012 just put a condition inside the loop; where you don't want the link remove the <a href=""></a> tag Quote Link to comment https://forums.phpfreaks.com/topic/264783-disable-current-age-link-with-preg_replace/#findComment-1357056 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.