Jump to content

hidden xml tags


mga_ka_php

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.