PHP code example of zjango / phtml

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

    

zjango / phtml example snippets


'providers' => array(
	...
	'Zjango\Phtml\PhtmlServiceProvider',
);

		'Phtml'	=>	'Zjango\Phtml\Facades\Phtml',

		$html=Phtml::init('http://www.apple.com');

		$as = $html->find('a');

		$a = $html->find('a',0);

		$a = $html->find('a',-1);

		$a = $html->find('a',0);
		$href = $a->href();
		$text = $a->text();