[Help] Unnecessary elements inside crawled values

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
miniramen
Forum Newbie
Posts: 5
Joined: Wed May 26, 2010 11:45 am

[Help] Unnecessary elements inside crawled values

Post by miniramen »

Hello guys, I've been trying to crawl a site, but unfortunately I get the value with a lot of useless junk.
For example: Most of the datas are like this...I tried strip_tags, but that doesn't entirely remove everything.
</th> <td align="left">Heritage Inn</td>

So what should I do?


-_- The other problem is, when the data starts going in the MYsql database, it found a " ' " value and gave an error message. Is there anyway I can deal
with that too?


Sorrry if my question sounds noobish, I'm surely learning to do all this properly bits by bits.
lunarnet76
Forum Commoner
Posts: 67
Joined: Sun Apr 04, 2010 2:07 pm
Location: Edinburgh

Re: [Help] Unnecessary elements inside crawled values

Post by lunarnet76 »

hi,

you can use htmlentities to remove all the entities (or it might be the opposite, I can't remember),

to avoid the problem of ' you should use mysql_real_escape_string !
Post Reply