Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8517283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:39:18+00:00 2026-06-11T05:39:18+00:00

Getting very confused with echoing an HTML anchor with a variable inside. <?php echo

  • 0

Getting very confused with echoing an HTML anchor with a variable inside.

<?php
echo '&nbsp;&nbsp;<a href="?p=" . $current_page +1" . ">Next</a>';
?>

I’ve tried so many variations of lost which ones I’ve tried. One of the attempts was with curly brackets { but still nothing. I know I’m getting my single and double quotes muddled up!

Could somebody please put me straight on this one. Also, what is the rules for apostrophes and quotes in PHP. If I want to echo something, what shall I start it with, an apostrophe or a quote.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T05:39:20+00:00Added an answer on June 11, 2026 at 5:39 am
    <?php
    echo '&nbsp;&nbsp;<a href="?p='.($current_page + 1).'">Next</a>';
    ?>
    

    If you want to do some math of other trickery inside an echo, you will need to surround it in brackets.

    Edit: @DaveRandom points out that the exception to the trickery clause is $var++ and ++$var.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a newbie at VBA and html and I'm getting very confused. I'm trying
I am very confused why my html tags are getting converted into html entities.
I am getting very confused in some concepts in c++. For ex: I have
This might be a very basic question, but I'm getting a bit confused. I'm
I'm getting very confused about how audio devices/lines/endpoints are named in windows (vista). First
I think I'm getting really confused with return'ing and echo'ing variables. I've got this
I'm getting very confused with memory management in relation to vectors and could do
Simple, very straight forward but seems uncle google and me getting confused. I have
I'm working on my first C++/CLI wrapper and am getting very confused wrt pointers.
Getting this error building a C++ project in VS2008. Very confused what it means,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.