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] => öööö \'\') 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. 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? 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. 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. 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
Archived
This topic is now archived and is closed to further replies.