purencool Posted November 19, 2010 Share Posted November 19, 2010 hi php freaks, have link in a menu that looks like the following. I have been able search the string using strpos($lines[$i],'title='). What I want to know is how do I get the school summary into a variable. <li><a href="../index.php" title="school summary">Summary</a></li> any help would be great Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted November 19, 2010 Share Posted November 19, 2010 You'd probably need to use regular expressions, to make it easier. Try something like this: $string = '<li><a href="../index.php" title="school summary">Summary</a></li>'; preg_match('/title="(.*?)"/', $string, $matches); $title = $matches[1]; echo $title; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.