mga_ka_php Posted March 18, 2009 Share Posted March 18, 2009 i'm getting information from a website using curl the data is in xml format and use preg_match to get the information like <php>content</php>, it will get content. and when i print it, it will display "content" but when i try to post it in the database when i check the database it, it will be posted as <php>content</php> what is the problem? Link to comment https://forums.phpfreaks.com/topic/149919-hidden-xml-tags/ Share on other sites More sharing options...
ILMV Posted March 18, 2009 Share Posted March 18, 2009 Well... you tell me whats the problem? Did you want it stored in the DB without the XML tags? Without seeing your code I assume that when you echo the <php>content</php> it will hide the tags because it does that with all HTML tags, such as <p>, <a> etc... You might want to consider using substr to clip the start and end tags off of the string, that will leave with just "content", so you can store that in your DB. Link to comment https://forums.phpfreaks.com/topic/149919-hidden-xml-tags/#findComment-787510 Share on other sites More sharing options...
syed Posted March 18, 2009 Share Posted March 18, 2009 I am assuming regiemon was just giving an example of <php>content</php>. Are there many tags that your are removing? Link to comment https://forums.phpfreaks.com/topic/149919-hidden-xml-tags/#findComment-787513 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.