Login   Register  
PHP Classes
elePHPant
Icontem

File: usage.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of lattuada  >  GPC_Validate  >  usage.php  >  Download  
File: usage.php
Role: Example script
Content type: text/plain
Description: examples file
Class: GPC_Validate
Validate and filter values of given types
Author: By
Last change:
Date: 2011-10-19 06:09
Size: 635 bytes
 

Contents

Class file image Download
<?php

ini_set
("error_reporting"E_ALL);
ini_set("display_errors"true);

require_once 
__DIR__ "/GPC_Validate.class.php";

$_GET['id'] = 22;
$_GET['name'] = "nicolas";
$_GET['nodes'] = array("a"=>121314);
$_GET['matrix'] = array("a"=>array("b"=>14), 1314);

$_GET = new GPC_Validate($_GET);

echo 
$_GET->getInt("id") . chr(10);

echo 
$_GET->getString("name""HTML") . chr(10);
echo 
$_GET["nodes"]->getInt("a") . chr(10);

$nodes $_GET["nodes"];

echo 
$_GET["matrix"]["a"]->getInt("b");

foreach (
$nodes as $key=>$value) {
    echo 
$key .chr(10);#cannot use the key null value returned
    
echo $value->toInt() .chr(10);
}