![]() |
| ||
| can I get a title from an html header tag? Good morning, Is there a php function that will take the text out of a tag in a variable that has HTML in it? What I want to do is get the text from in-between the <h1> tags and use it as a title in my meta tags. Let's say I have all my content in separate .php files like this <?phpNow in the php page I have <?php include("phpfile1.php"); ?> Is their any easier way? Or is this a decent way? Just trying to make it easier to add new content to my pages. thanks |
| ||
| Re: can I get a title from an html header tag? There might be, but it probably is grounded on regex |
| ||
| Re: can I get a title from an html header tag? I finally figured it out here is the code that works for me $g=strpos($y, "</h1>",1);Hey thank for your reference it kind of blew my mind. I hope this helps sme people |
| ||
| Re: can I get a title from an html header tag? If you're serious about html parsing etc, regex is the only way to fly. |
| ||
| Re: can I get a title from an html header tag? god thanks for the help. I don't know maybe I was hit in the head to many times as a child. I think what I'm hearing is, If I parse my content into arrays I can use different functions and switches and all that other funny stuff to manipulate the arrays to do my bidding. Is this so? Thanks, Dave |
| ||
| Re: can I get a title from an html header tag? Quote:
Of course you could still code that without regular expressions, but it is more of a pain. |
| ||
| Re: can I get a title from an html header tag? Quote:
|
| All times are GMT -4. The time now is 5:35 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC