Combining variable and html inside a PHP variable
<p>The code below is generating a result like this: <code>http://localhost/my_website/ contact-us</code></p>

<pre><code>$base_url="http://localhost/my_website/";
echo $link= "$base_url contact-us ";
</code></pre>

<p>But I am trying to get a result like this : <code>http://localhost/my_website/contact-us</code> </p>

<p>I have also tried the following code </p>

<pre><code>$base_url="http://localhost/my_website/";
echo $link= "$base_url.contact-us ";
</code></pre>

<p>but the result is like this <code>http://localhost/my_website/.contact-us</code></p>

<p>Could you please show me how to solve this problem?</p>

<h1>Edit</h1>

<p>I am very sorry, I did't clearly mention the exact problem I am facing here. I thought the above example would help my case. Actually I am trying to create a link that I will send at users email address.</p>

<p>My code</p>

<pre><code>$base_url="http://localhost/my_website/";
$random_hash="1";
echo $link="
&lt;a href='$base_url account/confirm_registration/$random_hash' target='_blank'&gt;$base_url   account/confirm_registration/$random_hash&lt;/a&gt;";
</code></pre>

<p>But it is generating like this</p>

<pre><code>http://localhost/my_website/ account/confirm_registration/1
</code></pre>
