0
div class="stars" span title="Money Locker :  Pulsa Gratis average
 rating 3.9" style="width:78%" span div


    $item['stars'] = $article->find('div.stars span', 0)->style;
                $item['stars'] = str_replace("width:", "", $item['stars']);

i want it span title= data only

i want this data "Money Locker : Pulsa Gratis average rating 3.9"

1 Answer 1

1

try 2 things:

use the "title" property ... need to be exists like the "style" exists as an attribute of this span tag

$title = $article->find('div.stars span', 0)->title;

or you can use regex, and take the title content between the qutation mark

preg_match("/span title=\"(.+?)\"/", )
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.