php

iconv utf-8 iso-8859-1

Example #1 iconv() example
<?php
$text = “This is the Euro symbol ‘€’.”;

echo ‘Original : ‘, $text, PHP_EOL;
echo ‘TRANSLIT : ‘, iconv(“UTF-8”, “ISO-8859-1//TRANSLIT”, $text), PHP_EOL;
echo ‘IGNORE   : ‘, iconv(“UTF-8”, “ISO-8859-1//IGNORE”, $text), PHP_EOL;
echo ‘Plain    : ‘, iconv(“UTF-8”, “ISO-8859-1”, $text), PHP_EOL;

?> (continue reading…)


fpdf矢量图 EPS / AI

EPS / AI

Informations

Author: Valentin Schmidt
License: Freeware
Version: 1.6
From: http://staff.dasdeck.de/valentin/fpdf/fpdf_eps/ (continue reading…)



How to compile PHP-Qt?

error code:

cmake ..
-- Found Qt-Version 4.5.0
CMake Error at cmake/modules/FindPHP5.cmake:139 (LIST):
  list index: 0 out of range (-0, 18446744073709551615)
Call Stack (most recent call first):
  CMakeLists.txt:13 (include)

-- /main
CMake Error at CMakeLists.txt:16 (MESSAGE):
  PHP5 could not be found!

-- Configuring incomplete, errors occurred!

(continue reading…)


PHP – $argv

$argv — 传递给脚本的参数数组

说明

包含当运行于命令行下时传递给当前脚本的参数的数组。

Note: 第一个参数总是当前脚本的文件名,因此 $argv[0] 就是脚本文件名。

Note: 这个变量仅在 register_argc_argv 打开时可用。 (continue reading…)


PHP内存溢出Allowed memory size of 解决办法

在PHP里,至少有一种情况内存不会得到自动释放,即便是手动调用 unset()。详情可考:http://bugs.php.net/bug.php?id=33595(continue reading…)


uniqid

uniqid
产生只一的值。
语法: string uniqid(string prefix);
返回值: 字符串
函数种类: 编码处理
内容说明 
本函数会依据当时的毫秒以及指定的前置字符串产生一个独一无二的字符串。参数 prefix 为前置的字符串,最多可达 114 字符。

echo uniqid();可以看到uniqid始终是一个不断变化的长度为13的十六进制数。
<?php
echo hexdec(uniqid())/(time()+microtime()); 
?>
输出基本上在1048576左右。
可以断定,uniqid就是当前时间精确到微秒再乘以1048576(2的20次幂)最后转换为十六进制得到的。

 

1 Comment more...

PHP5中static和const

Php代码 
  1. <?php
  2. class Counter
  3. {
  4. private static $count = 0;//定义一个静态属性 (continue reading…)

php格式化数字

number_format();

sprintf(“%04d”, 2) (continue reading…)


PHP 过滤器(Filter)

PHP 过滤器用于验证和过滤来自非安全来源的数据,比如用户的输入。

什么是 PHP 过滤器?

PHP 过滤器用于验证和过滤来自非安全来源的数据。

验证和过滤用户输入或自定义数据是任何 Web 应用程序的重要组成部分。

设计 PHP 的过滤器扩展的目的是使数据过滤更轻松快捷。 (continue reading…)


Copyright © 1996-2010 Add Lives. All rights reserved.
iDream theme by Templates Next | Powered by WordPress