lindm Posted February 18, 2010 Share Posted February 18, 2010 I have the following array which contains trailing slashes I need to remove. What is the best way to accomplish this? Array ( [Field1] => A [Field2] => Test [Field3] => öööö \'\') Quote Link to comment https://forums.phpfreaks.com/topic/192566-remove-trailing-slash-from-array/ Share on other sites More sharing options...
premiso Posted February 18, 2010 Share Posted February 18, 2010 You can use stripslashes. But if the data is coming from GET or POST, you might want to look into turning off magic_quotes, and those slashes will of never been added in the first place. Quote Link to comment https://forums.phpfreaks.com/topic/192566-remove-trailing-slash-from-array/#findComment-1014560 Share on other sites More sharing options...
lindm Posted February 19, 2010 Author Share Posted February 19, 2010 I read somewhere that magic_quotes will be permanently on in php6..is that correct? Quote Link to comment https://forums.phpfreaks.com/topic/192566-remove-trailing-slash-from-array/#findComment-1014685 Share on other sites More sharing options...
Alex Posted February 19, 2010 Share Posted February 19, 2010 I read somewhere that magic_quotes will be permanently on in php6..is that correct? As of PHP 6.0.0 magic_quotes is removed. Quote Link to comment https://forums.phpfreaks.com/topic/192566-remove-trailing-slash-from-array/#findComment-1014688 Share on other sites More sharing options...
lindm Posted February 19, 2010 Author Share Posted February 19, 2010 Great! Disabling magic quotes solved it. Quote Link to comment https://forums.phpfreaks.com/topic/192566-remove-trailing-slash-from-array/#findComment-1014884 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.