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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.