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 8028317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:06:11+00:00 2026-06-05T00:06:11+00:00

In PHP when you write a set a variable equal to a string wrapped

  • 0

In PHP when you write a set a variable equal to a string wrapped in grave accents, it gets executed as it would if it were inside a shell_exec() command. What does the grave accent symbol (`) ( not single quote) represent in PHP?

So, in php you can do all sorts of things to combine strings with variables, etc, what can I and can’t I do when using ` instead of ‘ or ” ?

  • 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-05T00:06:12+00:00Added an answer on June 5, 2026 at 12:06 am

    In the PHP, that character is called a backtick operator.

    A literal string wrapped in backticks is a T_ENCAPSED_AND_WHITESPACE token. You can confirm this by running something like this:

    print_r(token_get_all('<?php `uname`;'));
    

    which gives you this:

    Array
    (
        [0] => Array
            (
                [0] => 367
                [1] => <?php 
                [2] => 1
            )
    
        [1] => `
        [2] => Array
            (
                [0] => 313
                [1] => uname
                [2] => 1
            )
    
        [3] => `
        [4] => ;
    )
    

    And then run token_name(313) which gives you T_ENCAPSED_AND_WHITESPACE.

    To the parser, a string wrapped in backticks is equivalent to a string with variables in it like "hello $world". The literal/constant part of the string (the hello part) is T_ENCAPSED_AND_WHITESPACE.

    So to answer your question, anything that you can do to a string that contains variables you can do to a string wrapped in backticks.

    So why T_ENCAPSED_AND_WHITESPACE? Probably, because like a string containing variables, it’s value is determined at runtime. Whereas a T_CONSTANT_ENCAPSED_STRING (a normal literal string) is kind of like a constant in the eyes of the parser.

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

Sidebar

Related Questions

I'm continuing to write a maze generator to teach myself php... I've set up
I am trying to write to my database if a variable is equal to
I have a variable ( $output ) that is set to a string. To
I have a variable ( $output ) that is set to a string. To
I have been reusing the same variable $stmt in my PHP script to write
i want to set a variable to a particular date like this in php..how
How can I write php codes independent from XHTML codes?
I need to write php code to identify common e-mail errors, like inbox full
I'm using PDFlib library PHP to write PDF. Can I put an image as
Are there any libraries or tools specifically designed to help PHP programmers write Javascript?

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.