PHP Classes

File: example1.php

Recommend this page to a friend!
  Classes of Nima Nima   Text Iterator   example1.php   Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: Example 1
Class: Text Iterator
Iterate over a text string for external processing
Author: By
Last change: .
Date: 12 years ago
Size: 1,018 bytes
 

Contents

Class file image Download
<?php
/**
* Brute Force Search Class
*
*
*
* @package Brute Force Search Class
* @file example1.php
* ****************************************************************************
* This example not that twisted!
* It only demonstrates the class's functionality!
*/

@set_time_limit(0); //This might be useful. Searching might take too long!

header("Content-Type: text/plain");
require_once(
"brute_force.class.php");

function
example_callback($arg1, $i)
{
    echo
$i . ": " . $arg1 . "\n";
}

$vals = array("n", "i", "m", "a");
$brute_force = new brute_force("example_callback", 4, 4, $vals);
if(!
$brute_force->errormsg())
{
   
$brute_force->callback_break = false; //This indicates that searching would not be terminated by the callback function, By setting this to true, process will terminate whenever callback function returns true (refer to the documentation)
   
$brute_force->search();
}
else
{
    echo
"Brute Force Problem: " . $brute_force->errormsg() . "\n";
}
?>