Procedural File: utils.php
Source Location: /utils.php
Page Details:
Common routines file
This program is free software; you can redistribute it and/or modify it under the terms of the BSD License. Copyright(c) 2004 by Qiang Xue. All rights reserved. To contact the author write to Qiang Xue The latest version of PRADO can be obtained from: http://prado.sourceforge.net/
pradoDecodeData [line 67]
string|array pradoDecodeData(
string|array $data)
|
|
Decodes a string. The string is decoded by HTML-decoding special characters (&, ", ', <, >).
Parameters
| string|array |
$data |
the string or array of strings to be encoded |
pradoEncodeData [line 50]
string|array pradoEncodeData(
string|array $data)
|
|
Encodes a string. The string is encoded by HTML-encoding special characters (&, ", ', <, >).
Parameters
| string|array |
$data |
the string or array of strings to be encoded |
pradoEscapeQuotes [line 36]
mixed pradoEscapeQuotes(
mixed &$data)
|
|
Replaces each single quote with two single quotes. This function is mainly used to escape data used for SQL queries. It can process a single string or an array recursively.
Parameters
| mixed |
&$data |
the data to be processed |
pradoGetContextPath [line 83]
string pradoGetContextPath(
string $path, string $context)
|
|
Returns a path with respect to a context path. If the path is absolute, it will be returned without change. If the path is relative, the context path will be prefixed to it.
Parameters
| string |
$path |
the path to be translated |
| string |
$context |
the context path |
pradoIsAbsoluteUrl [line 267]
boolean pradoIsAbsoluteUrl(
string $url)
|
|
Check if a URL is absolute or not.
Parameters
| string |
$url |
the url to be checked |
pradoParseDate [line 180]
int pradoParseDate(
String $string, string $format)
|
|
Returns a valid timestamp
Parameters
| String |
$string |
date representation |
| string |
$format |
date format representaton (GNU Style) Thanks to Spotk |
pradoSendFile [line 96]
void pradoSendFile(
string $fileName, [mixed $mimeType = ""], [mixed $remoteFilename = ""], [mixed $inline = false])
|
|
Sends a file to the end-user. This method reads a server file and sends it to the end-user. It must be invoked before any header information is sent out.
Parameters
| string |
$fileName |
the absolute or relative (to the current executing script) path of the file to be sent. |
pradoSerializeObject [line 145]
string pradoSerializeObject(
mixed $object)
|
|
Serializes an object to a string. This method is meant to replace the serialize() function because the latter has a bug when serializing an object.
Parameters
| mixed |
$object |
the object to be serialized. |
pradoStripSlashes [line 24]
mixed pradoStripSlashes(
mixed &$data)
|
|
Strips back slashes from a string or an array.
Parameters
| mixed |
&$data |
the data to be processed |
pradoUnserializeObject [line 161]
mixed pradoUnserializeObject(
string $str)
|
|
Unserializes an object from a string. This method is meant to replace the unserialize() function because the latter has a bug when unserializing an object.
Parameters
| string |
$str |
the serialized data. |
|