![]() |
[Solved] Automatically replace the first & with a ? question mark. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: [Solved] Automatically replace the first & with a ? question mark. (/showthread.php?tid=70417) |
[Solved] Automatically replace the first & with a ? question mark. - wolfgang1983 - 04-05-2018 I have this code below which generates a query string for my url. But I would like to know is there away that it could automatically replace the first & with a ? question mark. PHP Code: $url = ''; RE: automatically replace the first & with a ? question mark. - jreklund - 04-05-2018 http://php.net/manual/en/function.substr.php PHP Code: $url = '?'.substr($url, 1); RE: automatically replace the first & with a ? question mark. - wolfgang1983 - 04-05-2018 Thanks to all who helped working solution PHP Code: $find = '&'; PHP Code: $url = ''; |