AloFramework documentation
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download

Namespaces

  • Alo
    • Cache
    • Controller
    • Db
    • Exception
    • Session
    • Statics
    • Test
    • Validators
  • Controller
  • None
  • PHP

Classes

  • Cookie
  • Format
  • Security

Class Format

Format validation statics

Namespace: Alo\Statics
Package: Statics
Author: Art <a.molcanovas@gmail.com>
Located at sys/class/alo/statics/format.php

Methods summary

public static boolean
# isJSON( mixed $data )

Checks whether the data is valid JSON

Checks whether the data is valid JSON

Parameters

$data
mixed
$data The data to check

Returns

boolean

Author

Art <a.molcanovas@gmail.com>
public static boolean
# is_ipv4_ip( string $input )

Checks if the supplied string is a valid IPv4 IP

Checks if the supplied string is a valid IPv4 IP

Parameters

$input
string
$input The input

Returns

boolean

Author

Art <a.molcanovas@gmail.com>
public static string
# scalarOutput( mixed $input, integer $prettify_method = Alo\Statics\Format::M_PRINT_R )

Makes output scalar. If $input is already scalar, simply returns it; otherwise uses a function specified in $prettify_method to make the output scalar

Makes output scalar. If $input is already scalar, simply returns it; otherwise uses a function specified in $prettify_method to make the output scalar

Parameters

$input
mixed
$input The input to scalarise
$prettify_method
integer
$prettify_method Function to use to make output scalar if $input isn't already scalar. See class M_* constants.

Returns

string
public static integer|float|mixed
# makeNumeric( mixed $var, boolean $boolMode = false )

Typecasts a variable to float or int if it's numeric

Typecasts a variable to float or int if it's numeric

Parameters

$var
mixed
$var The variable
$boolMode
boolean
$boolMode Whether we're checking for boolean mode FULLTEXT search values

Returns

integer|float|mixed

Author

Art <a.molcanovas@gmail.com>

Magic methods summary

Constants summary

integer M_SERIALIZE 0
#

Defines an method as "serialize"

Defines an method as "serialize"

integer M_JSON 1
#

Defines a method as "json_encode"

Defines a method as "json_encode"

integer M_PRINT_R 2
#

Defines a method as "print_r"

Defines a method as "print_r"

AloFramework documentation API documentation generated by ApiGen 2.8.0