Q:

Concat String and php Variable when appending in html

I have used below code:
$html = '';
$html. = '<br></br>';
$html .= '<a href= "javascript:void(0)" class= "test" onclick= "get_data($access_token,1,$marketTagId);">Next 50  </a>';

but my PHP variables are not recognized.

A:

Difference between Double quotes and single quotes
According to this Stackoverflow answer:

Single quoted strings will display things almost completely "as is." Variables and most escape sequences will not be interpreted. The exception is that to display a literal single quote, you can escape it with a back slash \', and to display a back slash, you can escape it with another backslash \\ (So yes, even single quoted strings are parsed).
Double quote strings will display a host of escaped characters (including some regexes), and variables in the strings will be evaluated. An important point here is that you can use curly braces to isolate the name of the variable you want evaluated. For example let's say you have the variable $type and you what to echo "The $types are" That will look for the variable $types. To get around this use echo "The {$type}s are" You can put the left brace before or after the dollar sign. Take a look at string parsing to see how to use array variables and such.

Solution
They are not recognized, because you have put all your string in single quotes (').
You should replace them all with double quotes (").
$html = "";
$html. = "<br></br>";
$html .= "<a href=\"javascript:void(0)\" class=\"test\" onclick=\"get_data('$access_token',1,'$marketTagId');\">Next 50</a>";

Another solution
Also you have the option of separating your variables from text:
$html = '';
$html. = '<br></br>';
$html .= '<a href="javascript:void(0)" class="test" onclick="get_data("' . $access_token . '",1,"' . $marketTagId . '");">Next 50</a>';

Yet another solution
If you don't want to escape so many double quotes, you may use single quotes instead:
$html = "";
$html. = "<br></br>";
$html .= "<a href='javascript:void(0)' class='test' onclick='get_data(\"$access_token\",1,\"$marketTagId\");'>Next 50</a>";

