PHP code example of rafaelnajera / xmlmatcher

1. Go to this page and download the library: Download rafaelnajera/xmlmatcher 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/ */

    

rafaelnajera / xmlmatcher example snippets


$token = XmlToken::elementToken('name');     // XML:  <name>
$token = XmlToken::endelementToken('name');  // XML: </name>
$token = XmlToken::textToken();              // XML: free text

$token = XmlToken::elementToken('name')
    ->withReqAttrs([ ['a', 'value'], ['b', '*']); // XML: <name a="value" b="whatever">