PHP code example of edwinhuish / css-to-xpath

1. Go to this page and download the library: Download edwinhuish/css-to-xpath library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

edwinhuish / css-to-xpath example snippets



// Will output //*[contains(concat(' ', normalize-space(@class), ' '), ' node ')]
echo CssToXpath::transform('.node');

// Will output //*[@id='someid']
echo $translator->translate('#someid');