Hi, is there any php function can read text between tags or quotes.
For example, I have This is heading 1 and "This is text in Quote", how can I use php to read the text between tags or the text between quotes? I know I can use substr but is there any function that can directly read the text?
I would also like to know how to do this.
---
I don't know the answer, but I think I was looking for the exact same thing. I wanted a php script that would visit http://www.whatismyip.com and extract my IP address which was written in the HTML as follows: Your IP Is xxx.xxx.xxx.xxx
No. Your application can be solved using substr alone.
What I try to do is when I use fget() to read a file or a webpage, I can retrieve text in heading. For example, when I used fget("http://www.whatismyip.com") to read the web page, I can get Your IP - xxx.xxx.xxx.xx. What I want to do is the php script can read "Your IP - xxx.xxx.xxx.xx" directly for me and stored in db. But since I'm not only want to read the heading text, but also etc, I have to write many line to retrive each data. If there is any function can read something within a specifc tags (say between or ) then it would be great.
zippee, you'll want to learn how to use Regular Expressions in PHP. You can find a good Regular Expression tutorial that includes examples for what you are wanting here .