PHP Classes

File: usage.php

Recommend this page to a friend!
  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: 12 years ago
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"=>12, 13, 14);
$_GET['matrix'] = array("a"=>array("b"=>14), 13, 14);

$_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);
}