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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:48:15+00:00 2026-05-22T16:48:15+00:00

Here is some example code: $headers = ‘From: webmaster@example.com’ . "\r\n" . ‘Reply-To: webmaster@example.com’

  • 0

Here is some example code:

$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

What does the period character do in the middle of each piece of the string?

For example,

"blabla" . "blabla" . "blablalba";
  • 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-05-22T16:48:16+00:00Added an answer on May 22, 2026 at 4:48 pm

    This operator is used to combine strings.

    EDIT

    Well, to be more specific if a value is not a string, it has to be converted to one. See Converting to a string for a bit more detail.

    Unfortunately it’s sometimes mis-used to the point that things become harder to read. Here are okay uses:

    echo "This is the result of the function: " . myfunction();
    

    Here we’re combining the output of a function. This is okay because we don’t have a way to do this using the standard inline string syntax. A few ways to improperly use this:

    echo "The result is: " . $result;
    

    Here, you have a variable called $result which we can inline in the string instead:

    echo "The result is: $result";
    

    Another hard to catch mis-use is this:

    echo "The results are: " . $myarray['myvalue'] . " and " . $class->property;
    

    This is a bit tricky if you don’t know about the {} escape sequence for inlining variables:

    echo "The results are: {$myarray['myvalue']} and {$class->property}";
    

    About the example cited:

    $headers = 'From: webmaster@example.com' . "\r\n" .
        'Reply-To: webmaster@example.com' . "\r\n" .
        'X-Mailer: PHP/' . phpversion();
    

    This is a bit tricker, because if we don’t use the concatenation operator, we might send out a newline by accident, so this forces lines to end in “\r\n” instead. I would consider this a more unusual case due to restrictions of email headers.

    Remember, these concatenation operators break out of the string, making things a bit harder to read, so only use them when necessary.

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

Sidebar

Related Questions

I'm trying to extract functions and function headers from some source code files. Here's
Here's some example code: class Obj attr :c, true def == that p '=='
I'm looking for something like break for loops. Here's some example code (using Symfony's
I have html like so: <div class=foo> (<a href=forum.example.com>forum</a>) <p> Some html here.... </div>
So I have some code here that takes user input from a standard web
Here is some example data: data = data.frame(series = c(1a, 1b, 1e), reading =
I'm working on a stored proc that executes some dynamic sql. Here's the example
Im trying to hammer togehter a WYSIWYG-edit in c# following some examples from here
Here is some code I could not get to format properly in markdown, this
Here's some Ruby code: puts %x{ pstree #{$$} } # never forks puts %x{

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.