I'm trying to output a button using PHP but I cant seem to get the '
and "
correctly.
This is the output I should be getting from the PHP code below:
<button class="button button1" onclick="buttonTest(99.16918,-82.9191)"> Lithuania </button>
This is my code:
foreach ($getClasses as $row){
echo '<button class="button button1" onclick="buttonTest(', $row->BUILDING_Latitude ,',',$row->BUILDING_Longtitude,)>', $row->COURSE_Title,'</button>';
}
how do i get php to output this html code above i get an error
syntax error, unexpected '>' (48) : eval()'d code
syntax error, unexpected ')', expecting ',' or ';' (48) : eval()'d code
Update
Also, please advice me the best way to rewrite this, so that these kind of issues do not occur in the future.