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 Link to comment https://forums.phpfreaks.com/topic/219147-copya-part-of-a-string/ 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; Link to comment https://forums.phpfreaks.com/topic/219147-copya-part-of-a-string/#findComment-1136418 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.