Jump to content

grep


sandy1028

Recommended Posts

From what I know, you'll probably want to loop through $data and use preg_match or preg_match all.

 

I think this RegExp should work: Results(.*?)seconds

 

Edit: not sure if there are spaces between Results and seconds. You probably want to include spaces. But again, you haven't told me much.

 

Also, http://www.phpfreaks.com/forums/index.php/topic,250066.0.html.

 

That's your other topic. Same thing. You can use the same RegExp for this with a few changes.

Link to comment
https://forums.phpfreaks.com/topic/156107-grep/#findComment-821866
Share on other sites

<p> Results <b>1</b> - <b>10</b> of about <b>87,800,000</b> for <b>aaa</b> [<a href="/url?q=http://www.answers.com/aaa&r=67&ei=VCn5ScLKCtWGkAWmmM2LCg&sa=X&oi=dict&ct=d&usg=AFQjCNHhNb5eNJ7HxcW4GRMeBmfbiYe5cw"
title="Look up definition of aaa">definition</a>]<b></b>.  (<b>0.08</b> seconds) </div><div id=res class=med><!--a--><h2 class=hd>Search Results</h2><div><ol><!--m--><link rel="prefetch" href="http://www.aaa.com/"><li class=g><h3 class=r>
<a href="http://www.aaa.com/" class=l onmousedown="return clk(this.href,'','','res','1','')"><em>AAA</em> - 

 

How to extract only the string between Results and from seconds and delete the other characters.

Link to comment
https://forums.phpfreaks.com/topic/156107-grep/#findComment-822437
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.