I have a string that terminates prematurely because of '&q' (I'm guessing) being escaped in the original string. How should I handle this if I want to retain the original string in PHP?
Original string
'http://answers.onstartups.com/search?tab=active&q=fbi'
Result of var_dump
'["http://answers.onstartups.com/search?tab=active'
JS
var linksStr = $("#links").val();
var matches = JSON.stringify(linksStr.match(/\bhttps?:\/\/[^\s]+/gi));
$.ajax({
type: 'GET',
dataType: 'json',
cache: false,
data: 'matches=' + matches,
url: 'publishlinks/check_links',
success:
function(response) {
alert(response);
}
})
check_links
$urls = $this->input->get('matches');
var_dump($urls);