SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP output variable

    Below is my code:

    $mail->AddReplyTo('administration@chatpointworld.com', '$elang23');

    The script im using only allows use of single quotes, but im trying to output $elang23. Instead of outputting the information in the variable it just outputs $elang23. What is a good way to solve this?
    Animated Chatrooms - www.121chatrooms.net

  2. #2
    Community Advisor bronze trophy
    fretburner's Avatar
    Join Date
    Apr 2013
    Location
    Brazil
    Posts
    1,407
    Mentioned
    45 Post(s)
    Tagged
    12 Thread(s)
    Hi Mike,

    Just remove the quotes around the variable name and PHP will substitute the value when the script runs:
    PHP Code:
    $mail->AddReplyTo('administration@chatpointworld.com'$elang23); 

  3. #3
    SitePoint Addict bronze trophy
    Join Date
    Apr 2013
    Location
    Ithaca
    Posts
    351
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    Actually the double quote " " works fine too, single quote does not execute PHP variables though which can be a bit confusing for newbies.

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    88
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I'm curious. What do you mean by "script im using only allows use of single quotes"?

  5. #5
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks it works without quotes, it was for the phpmailer script
    Animated Chatrooms - www.121chatrooms.net


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •