php - pagination bold on page click

529

I'm trying to get the link to turn bold when i click on the page but the following code is failing me. can somebody point out what i'm doing wrong?

for($i=1;$i<=$pages;$i++)
{       
    echo ($i == @$page) ? '<strong><a href="?page='.$i.'">'.$i.'</a> </strong> ': '<a href="?page='.$i.'">'.$i.'</a> ';
}

People are also looking for solutions to the problem: javascript - php semi colon delimited, have problems with a conditional

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.