1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

debugging of data read with phpQuery

Discussion in 'PHP' started by mstdmstd, Oct 29, 2017.

  1. #1
    Hello,
    Can you advice some tools(php7/laravel5) for debugging/review of data read with phpQuery?
    I mean when I need to get data-attribute of H2 tag I write:

    1. $pq = pq($nextContainerDivItem);
    2. $nextTitle= $pq->find('h2.s-access-title');
    3. echo '<pre>$nextTitle::</pre>';
    4. dump($nextTitle);
    5. $next_title= !empty($nextTitle->attr('data-attribute') ) ? $nextTitle->attr('data-attribute') : '';
    I googled the right decision and now in $next_title valid value, but debugging the output
    https://imgur.com/a/bwEKS

    is not really usefull, as I could not review the value in dumping: I suppose to find it in path elements->attributes,
    but as you see at printscreen.
    SEMrush
    If there is better of dumping ? If possible with options to show some nodes. Say not empty or specifile in path, as if ["elements->attributes"]
    specified show it opened.

    Also when I write wrong path/class I have some output like in printscreen above.
    I would like in some way to show if the node was found or not?
    If there is way to make it?
    Which debugging tools do you use with phpQuery requests ?

    Thanks!
     
    mstdmstd, Oct 29, 2017 IP
    SEMrush