jokemiri jokemiri - 2 years ago 177
PHP Question

How do I escape quotes in url

Please I have a little knowledge on this, I want to insert url all into single quotes. I have tried using both single and double wuotes, but not working. I checked this question - Escaping single quote in url link, but did not help

echo '\'' base_url().'\'index.php?admin/product/delete/1\'';
echo '\''; echo base_url().index.php?admin/product/delete/1\'';
echo '\'. base_url().index.php?admin/product/delete/1\'';
echo "\'"; echo base_url().'index.php?admin/product/delete/1\'";

I am trying to achieve this:

the url in single quotes

Answer Source

If you really want to use only single quotes, try this:

echo '\''.base_url().'index.php?admin/product/delete/1\'';
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download