i have code like this :
<?php
echo '<a onclick="function(''.$some.'');">';
?>
how can it return html like this :
<a onclick="function('some');">
Big Thanks
i have code like this :
<?php
echo '<a onclick="function(''.$some.'');">';
?>
how can it return html like this :
<a onclick="function('some');">
Big Thanks
Since you quoted the string with single quotes, you have to escape them inside the string.
Simply add a backslash \
before each single quote inside the string:
<?php
echo '<a onclick="function(\''.$some.'\');"';
?>
Also you can do that in a few other ways like:
echo "<a onclick=\"function('{$some}');\"";
Double quotes lets you simply embed a variable instead of concating, but now you have to escape double quotes.