clowes Posted July 21, 2009 Share Posted July 21, 2009 This has been bugging me for too long now. I dont understand or appreciate it, and I cant sort it out for the life of me. Help greatly appreciated. So I query a server, and collect some data. I display the data on my page. The following word: Interdomain’s is present. If I view source, it is displayed as Interdomain’s I want to remove all words after this, so what I do is use strpos to find the position, and then use substr to stop at this point. Simple. If I strpos either Interdomain’s, or Interdomain’s I get nothing.... If I strpos Interdomain, I get the right position... I.E These special chars are preventing me from getting what I want. Another example. The following is displayed: ———————————————————————— On viewing source I see: ———————————————————————— In this case I simply want to delete these dashes, so I use str_replace(); Putting either of the above into str_replace does nothing.... Ive tried utilizing strip_tags(); htmlspecialchars_decode(); etc to give just a plain text version... they do absolutely nothing. I am super confused.Help! Quote Link to comment https://forums.phpfreaks.com/topic/166840-html-special-chars-wont-go-away/ Share on other sites More sharing options...
ignace Posted July 21, 2009 Share Posted July 21, 2009 please post your code Quote Link to comment https://forums.phpfreaks.com/topic/166840-html-special-chars-wont-go-away/#findComment-879780 Share on other sites More sharing options...
clowes Posted July 21, 2009 Author Share Posted July 21, 2009 This query is not specific to a piece of code. It is a general question. Why does strpos and str_replace not work with these html characters essentially. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/166840-html-special-chars-wont-go-away/#findComment-879814 Share on other sites More sharing options...
clowes Posted July 22, 2009 Author Share Posted July 22, 2009 Can anyone help with this? Quote Link to comment https://forums.phpfreaks.com/topic/166840-html-special-chars-wont-go-away/#findComment-880256 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.