无需言 做自己 业 ,精于勤 荒于嬉.

Date/Time 函数 date_create_from_format 别名 DateTime::createFromFormat()

发表日期:2021-07-01 08:55:26 | 来源: | 分类:Date/Time 函数

date_create_from_format

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

date_create_from_format别名 DateTime::createFromFormat()

说明

此函数是该函数的别名: DateTime::createFromFormat()

阅读全文 »

Date/Time 函数 date_default_timezone_set 设定用于一个脚本中所有日期时间函数的默认时区

发表日期:2021-07-01 08:55:26 | 来源: | 分类:Date/Time 函数

      示例1
<?php 
date_default_timezone_set('America/Los_Angeles');
$script_tz = date_default_timezone_get();
if (strcmp($script_tz, ini_get('date.timezone'))){
    echo 'Script timezone differs from ini-set timezone.';
}
 else {
    echo 'Script timezone and ini-set timezone match.';
}
?>

阅读全文 »

Date/Time 函数 date_default_timezone_get 取得一个脚本中所有日期时间函数所使用的默认时区

发表日期:2021-07-01 08:55:26 | 来源: | 分类:Date/Time 函数

      示例1
<?php 
date_default_timezone_set('Europe/London');
if (date_default_timezone_get()) {
    echo 'date_default_timezone_set: ' . date_default_timezone_get() . '<br />';
}
if (ini_get('date.timezone')) {
    echo 'date.timezone: ' . ini_get('date.timezone');
}
?>

      示例2
<?php 
date_default_timezone_set('America/Los_Angeles');
echo date_default_timezone_get() . ' => ' . date('e') . ' => ' . date('T');
?>

阅读全文 »

Date/Time 函数 date_date_set 别名 DateTime::setDate()

发表日期:2021-07-01 08:55:26 | 来源: | 分类:Date/Time 函数

date_date_set

(PHP 5 >= 5.2.0, PHP 7, PHP 8)

date_date_set别名 DateTime::setDate()

说明

此函数是该函数的别名: DateTime::setDate()

阅读全文 »

Date/Time 函数 date_diff 别名 DateTime::diff()

发表日期:2021-07-01 08:55:26 | 来源: | 分类:Date/Time 函数

date_diff

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

date_diff别名 DateTime::diff()

说明

此函数是该函数的别名: DateTime::diff()

阅读全文 »

Date/Time 函数 date_create 别名 DateTime::__construct()

发表日期:2021-07-01 08:55:26 | 来源: | 分类:Date/Time 函数

date_create

(PHP 5 >= 5.2.0, PHP 7, PHP 8)

date_create别名 DateTime::__construct()

说明

此函数是该函数的别名: DateTime::__construct()

阅读全文 »

Date/Time 函数 date_interval_create_from_date_string 别名 DateInterval::createFromDateString()

发表日期:2021-07-01 08:55:26 | 来源: | 分类:Date/Time 函数

date_interval_create_from_date_string

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

date_interval_create_from_date_string别名 DateInterval::createFromDateString()

说明

此函数是该函数的别名: DateInterval::createFromDateString()

阅读全文 »

Date/Time 函数 date_modify 别名 DateTime::modify()

发表日期:2021-07-01 08:55:26 | 来源: | 分类:Date/Time 函数

date_modify

(PHP 5 >= 5.2.0, PHP 7, PHP 8)

date_modify别名 DateTime::modify()

说明

此函数是该函数的别名: DateTime::modify()

阅读全文 »

Date/Time 函数 date_get_last_errors 别名 DateTime::getLastErrors()

发表日期:2021-07-01 08:55:26 | 来源: | 分类:Date/Time 函数

date_get_last_errors

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

date_get_last_errors别名 DateTime::getLastErrors()

说明

此函数是该函数的别名: DateTime::getLastErrors()

阅读全文 »

Date/Time 函数 date_format 别名 DateTime::format()

发表日期:2021-07-01 08:55:26 | 来源: | 分类:Date/Time 函数

date_format

(PHP 5 >= 5.2.0, PHP 7, PHP 8)

date_format别名 DateTime::format()

说明

此函数是该函数的别名: DateTime::format()

阅读全文 »

Date/Time 函数 date_offset_get 别名 DateTime::getOffset()

发表日期:2021-07-01 08:55:26 | 来源: | 分类:Date/Time 函数

date_offset_get

(PHP 5 >= 5.2.0, PHP 7, PHP 8)

date_offset_get别名 DateTime::getOffset()

说明

此函数是该函数的别名: DateTime::getOffset()

阅读全文 »

Date/Time 函数 date_parse 返回指定日期/时间的详细信息的关联数组

发表日期:2021-07-01 08:55:26 | 来源: | 分类:Date/Time 函数

      示例1
<?php 
print_r(date_parse("2006-12-12 10:00:00.5"));
?>

      示例2
<?php 
print_r(date_parse("2006-12-12 10:00:00.5 +1 week +1 hour"));
?>

阅读全文 »

Date/Time 函数 date_interval_format 别名 DateInterval::format()

发表日期:2021-07-01 08:55:26 | 来源: | 分类:Date/Time 函数

date_interval_format

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

date_interval_format别名 DateInterval::format()

说明

此函数是该函数的别名: DateInterval::format()

阅读全文 »

Date/Time 函数 date_sub 别名 DateTime::sub()

发表日期:2021-07-01 08:55:26 | 来源: | 分类:Date/Time 函数

date_sub

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

date_sub别名 DateTime::sub()

说明

此函数是该函数的别名: DateTime::sub()

阅读全文 »

Date/Time 函数 date_parse_from_format Get info about given date formatted according to the specified format

发表日期:2021-07-01 08:55:26 | 来源: | 分类:Date/Time 函数

      示例1
<?php 
$date = "6.1.2009 13:00+01:00";
print_r(date_parse_from_format("j.n.Y H:iP", $date));
?>

阅读全文 »

Date/Time 函数 date_create_immutable 别名 DateTimeImmutable::__construct()

发表日期:2021-07-01 08:55:25 | 来源: | 分类:Date/Time 函数

date_create_immutable

(PHP 5 >= 5.5.0, PHP 7, PHP 8)

date_create_immutable别名 DateTimeImmutable::__construct()

说明

此函数是该函数的别名: DateTimeImmutable::__construct()

阅读全文 »

Date/Time 函数 checkdate 验证一个格里高里日期

发表日期:2021-07-01 08:55:25 | 来源: | 分类:Date/Time 函数

      示例1
<?php 
var_dump(checkdate(12, 31, 2000));
var_dump(checkdate(2, 29, 2001));
?>

阅读全文 »

Date/Time 函数 date_create_immutable_from_format 别名 DateTimeImmutable::createFromFormat()

发表日期:2021-07-01 08:55:25 | 来源: | 分类:Date/Time 函数

date_create_immutable_from_format

(PHP 5 >= 5.5.0, PHP 7, PHP 8)

date_create_immutable_from_format别名 DateTimeImmutable::createFromFormat()

说明

此函数是该函数的别名: DateTimeImmutable::createFromFormat()

阅读全文 »

OpenSSL 函数 openssl_x509_export_to_file 导出证书至文件

发表日期:2021-07-01 08:55:24 | 来源: | 分类:OpenSSL 函数

openssl_x509_export_to_file

(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)

openssl_x509_export_to_file导出证书至文件

说明

openssl_x509_export_to_file(mixed $x509, string $outfilename, bool $notext = true): bool

openssl_x509_export_to_file()x509 以PEM编码的格式保存到名为 outfilename 的文件中。

参数

x509

参见密钥/证书参数以获取有效值列表。

outfilename

输出文件的路径。

notext

可选参数 notext 影响输出的冗余度。如果设为 false,输出内容将包含附加的人类可读信息。notext 的缺省值为 true

返回值

成功时返回 true, 或者在失败时返回 false

阅读全文 »

OpenSSL 函数 openssl_verify 验证签名

发表日期:2021-07-01 08:55:24 | 来源: | 分类:OpenSSL 函数

      示例1
<?php 
// $data and $signature are assumed to contain the data and the signature// fetch public key from certificate and ready it$pubkeyid = openssl_pkey_get_public("file://src/openssl-0.9.6/demos/sign/cert.pem");
// state whether signature is okay or not$ok = openssl_verify($data, $signature, $pubkeyid);
if ($ok == 1) {
    echo "good";
}
 elseif ($ok == 0) {
    echo "bad";
}
 else {
    echo "ugly, error checking signature";
}
// free the key from memoryopenssl_free_key($pubkeyid);
?>

      示例2
<?php 
//data you want to sign$data = 'my data';
//create new private and public key$private_key_res = openssl_pkey_new(array(    "private_key_bits" => 2048,    "private_key_type" => OPENSSL_KEYTYPE_RSA,));
$details = openssl_pkey_get_details($private_key_res);
$public_key_res = openssl_pkey_get_public($details['key']);
//create signatureopenssl_sign($data, $signature, $private_key_res, "sha1WithRSAEncryption");
//verify signature$ok = openssl_verify($data, $signature, $public_key_res, OPENSSL_ALGO_SHA1);
if ($ok == 1) {
    echo "valid";
}
 elseif ($ok == 0) {
    echo "invalid";
}
 else {
    echo "error: ".openssl_error_string();
}
?>

阅读全文 »

全部博文(1589)
集速网 copyRight © 2015-2025 宁ICP备15000399号-1 宁公网安备 64010402001209号
与其临渊羡鱼,不如退而结网
欢迎转载、分享、引用、推荐、收藏。