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? Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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.