PHP code example of bca / fontawesomeiterator

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

    

bca / fontawesomeiterator example snippets


use BCA\FontAwesomeIterator\Iterator as FontAwesomeIterator;

$icons = new FontAwesomeIterator('path/to/fontawesome.css');

foreach ($icons as $icon) {
    echo $icon->class; // Do Something Here
}

while ($icons->valid()) {
    $icon = $icons->current();
    echo $icon->class; // Do Something Here
    $icons->next();
}

$icons = new FontAwesomeIterator('path/to/fontawesome.css', 'icon');

$icons = new FontAwesomeIterator('path/to/fontawesome.css', 'my-custom-prefix');

<select>

    foreach ($icons as $icon) {
        echo '<option value="'.$icon->class.'">'.$icon->name.'</option>';
    }