html - how to use single and double quotes with brackets in php?
664
i have a problem using with single and double quotes with brackets in php
$nestedData[] = '<a href="JavaScript:newPopup('loghistory.php?logid='.$row['user_id'].'')"> History('.$countqry.')</a>';
Answer
Solution:
You need to escape the quotes or concat the strings:
You can change to:
Or another option:
Answer
Solution:
You can escape single and double quotes with \ Like this:
Answer
Solution:
try the below code:
Answer
Solution:
If you wish to output a single tick from within a litteral string then you will need to escape that single quote:
Will output:
Graeme's example
Answer
Solution:
Escape the quotes with \
this should do the trick
Answer
Solution: