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

  • Home
  • SEARCH
  • 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 6364381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:09:23+00:00 2026-05-25T00:09:23+00:00

Im just curious as to what is the difference to these 3 types of

  • 0

Im just curious as to what is the difference to these 3 types of strings.

echo "Hello my name is ".$name;

echo "Hello my name is $name";

echo "Hello my name is {$name}";

I know that in the third case its required over the 2nd when your using arrays with keys. For example, i know the following wont work.

echo "Hello my name is $data['name']";

You would need to do…

echo "Hello my name is{$data['name']}";

for it to work.

Does anyone have an explanation as to why this is?

  • 1 1 Answer
  • 1 View
  • 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-05-25T00:09:23+00:00Added an answer on May 25, 2026 at 12:09 am

    People are giving their opinion, it’s fine, but here are facts :

    • Concatenation is faster
    • The time gained by concatenating is trivial and not a good argument to justify its use
    • In the end, the code does the same thing whatever method you choose

    Basically, it does not matter how you do it, just choose your favorite and stick with it. If you work with a group of people, just use the same convention, for clean code’s sakes.

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

Sidebar

Related Questions

I'm just curious to know if there is any significant/serious difference in these three
It's not very important but I was just curious to know the difference. echo
Just curious what the difference is between these two in a Rails gem: write_inheritable_attribute(:sample,
I was just curious to know why structs, strings etc are immutable? What is
Firstly apologies if this a very basic question, I'm just curious to know the
I'm just curious: Is there a difference on speed and performance between this two
I am just a bit curious about the new function std::move() that has just
Just curious about which of these would be faster? $('ul.dropdown a').first().click(function(event) { event.stopPropagation(); return
Just curious if there was anything that made a partial view different from a
Just curious about what would be the django way of achieving the following :

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.