I need to get url data printed in the following format below
JavaScript
x
https://mysite/data/api?q="'xxxxx' in contents"
but each time i run the code below am getting something like this below which is not what I want
JavaScript
https://mysite/data/api?q=xxxxx in contents
here is what I have tried
JavaScript
$my_id = 'xxxxx';
$myurl= "https://mysite/data/api?q={$my_id}";
echo $myurl . " in contents";
Advertisement
Answer
Try like this HTML code in your variable declaration:
JavaScript
<?php
$my_id = '"'xxxxx'';
$myurl= "https://mysite/data/api?q={$my_id}";
echo $myurl . " in contents" ";
?>
You will get the output like this:
JavaScript
https://mysite/data/api?q="'xxxxx' in contents"