i need this in php to javascript.
echo preg_replace('/(\S)+\?/', '', 'http://example.com/?test=1');
THX
BTW: I tried
alert('http://example.com/?test=1'.replace('/(\S)+\?/g', ''));
but no happens.
i need this in php to javascript.
echo preg_replace('/(\S)+\?/', '', 'http://example.com/?test=1');
THX
BTW: I tried
alert('http://example.com/?test=1'.replace('/(\S)+\?/g', ''));
but no happens.