PHP code example of baha2rmirzazadeh / phpscanner

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

    

baha2rmirzazadeh / phpscanner example snippets


use PHPScanner\Scanner\Scanner;

$scn = new Scanner();
$a = $scn->nextString();
print $a;

$m = $scn->nextFloat();
print $m;

$a = array();
for ($i = 0; $i < 3; $i++) {
    $a[$i] = $scn->nextInt();
}
print_r($a);

$file_reader = new Scanner("C:\Users\Baha2r\Desktop\A.txt");
$file = "";
while ($file_reader->hasNext()) {
    $file .= $file_reader->nextLine();
}
$file_reader->close();
print $file;
echo "\n";