Jump to content

smart help needed


karthikeyan_coder

Recommended Posts

Hello,

 

I have this text.

$string = "blab blab some useless html tags here

<strong>Downloads:</strong> 1,826

</p> and some other ";

 

I need to get number of downloads only.

 

I have no guess about this. how to fetch the data the resides between "Downloads:</strong>" and </p>

 

Note: that page may have too many "Downloads" words and </strong> tags. so "Downloads:</strong>" would be a best initial needle for fetching..

 

Help me please.

Link to comment
https://forums.phpfreaks.com/topic/75244-smart-help-needed/
Share on other sites

you could do something like this, my first attempt anyway :)

 


$string = "blab blab some useless html tags here
<strong>Downloads:</strong> 1,826
</p> and some other ";

$var = explode(":",$string); 
//this will split the string into two pieces.

$downloads = substr($var[1],9,4); //go out 9 chars and take the next 4

 

 

 

question, how are you getting the download count initially? can the grab be done prior to display?

 

 

Link to comment
https://forums.phpfreaks.com/topic/75244-smart-help-needed/#findComment-380568
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.