dtdetu Posted December 22, 2008 Share Posted December 22, 2008 hello can anyone help me how to solve this problem i want to get the content of this string <p><small>21 December 2008 4:08 PM, PST</small></p> <p>No, she's not running nekkid through London's filthy streets. This time, <a href="/name/nm1561881/">Amy Winehouse</a> is scoring her weekly dose of train-wreckognition by stripping down for a Beach romp on the Caribbean island of St. Lucia. And we've got to say, that in her News of the World slide show frolic, she looks much better than we'd expected. For anyone else, this could be a career crisis, but for Amy it looks like a relatively healthy step in the right direction. Go figure!</p> i want to get No, she's not running nekkid through London's filthy streets. This time, <a href="/name/nm1561881/">Amy Winehouse</a> is scoring her weekly dose of train-wreckognition by stripping down for a Beach romp on the Caribbean island of St. Lucia. And we've got to say, that in her News of the World slide show frolic, she looks much better than we'd expected. For anyone else, this could be a career crisis, but for Amy it looks like a relatively healthy step in the right direction. Go figure! part of the string i am using preg_match("~<p><small>[^<]*<small>\s*<p>(.*?)</p>~i", $go, $content); but it doesnt work can anyone help please. thanks Link to comment https://forums.phpfreaks.com/topic/138012-solved-preg_match-help/ Share on other sites More sharing options...
JasonLewis Posted December 22, 2008 Share Posted December 22, 2008 Probably not very good but try this: $str = <<<html <p><small>21 December 2008 4:08 PM, PST</small></p> <p>No, she's not running nekkid through London's filthy streets. This time, <a href="/name/nm1561881/">Amy Winehouse</a> is scoring her weekly dose of train-wreckognition by stripping down for a Beach romp on the Caribbean island of St. Lucia. And we've got to say, that in her News of the World slide show frolic, she looks much better than we'd expected. For anyone else, this could be a career crisis, but for Amy it looks like a relatively healthy step in the right direction. Go figure!</p> html; preg_match("#<p>.*?</p>.*<p>(.*?)</p>#is", $str, $match); echo $match[1]; Link to comment https://forums.phpfreaks.com/topic/138012-solved-preg_match-help/#findComment-721314 Share on other sites More sharing options...
dtdetu Posted December 22, 2008 Author Share Posted December 22, 2008 thanks for reply but i couldnt get the needed values, i am using it on http://www.imdb.com/news/ and code gives me Content: Learn how to submit your original news content to our site with IMDb NewsDesk. can u help more please thanks Link to comment https://forums.phpfreaks.com/topic/138012-solved-preg_match-help/#findComment-721322 Share on other sites More sharing options...
effigy Posted December 22, 2008 Share Posted December 22, 2008 %</small>\s*</p>\s*<p>(.*?)</p>%si Link to comment https://forums.phpfreaks.com/topic/138012-solved-preg_match-help/#findComment-721457 Share on other sites More sharing options...
dtdetu Posted December 22, 2008 Author Share Posted December 22, 2008 hey i used preg_match("%</small>\s*</p>\s*<p>(.*?)</p>%si", $go, $content); then i get this error, is % has something msnbcLinks {font-size:11px; font-family:Arial, Helvetica, sans-serif; color: #999; margin-top: 5px; background: transparent; text-align: center; width: 425px;} .msnbcLinks a {text-decoration:none !important; border-bottom: 1px dotted #999 !important; font-weight:normal !important; height: 13px;} .msnbcLinks a:link, .msnbcLinks a:visited {color: #5799db !important;} .msnbcLinks a:hover, .msnbcLinks a:active {color:#CC0000 !important;} Visit msnbc.com for Breaking News, World News, and News about the Economy Christmas came early for the Duggar family, in the form of Jordyn-Grace Makiya, born – via C-section – last Thursday. Now that the baby's home, and "sleeping very well," says her father, Jim Bob Duggar, the family of 20 (minus eldest and married son Josh) flashed their collective smiles it is not i want to get:( Link to comment https://forums.phpfreaks.com/topic/138012-solved-preg_match-help/#findComment-721471 Share on other sites More sharing options...
effigy Posted December 22, 2008 Share Posted December 22, 2008 So what do you want? What you posted is the latest news entry. Link to comment https://forums.phpfreaks.com/topic/138012-solved-preg_match-help/#findComment-721477 Share on other sites More sharing options...
dtdetu Posted December 22, 2008 Author Share Posted December 22, 2008 wow very weird entry:) i didnt think that would be entry but it is thank you very much:) Link to comment https://forums.phpfreaks.com/topic/138012-solved-preg_match-help/#findComment-721480 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.