Blogger Information
Blog 5
fans 0
comment 0
visits 3224
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
PHP中的数据类型转换通过系统函数实现
Wuy丶
Original
487 people have browsed it
<?php

	//设置错误级别。E_ALL但是除了NOTICE
	error_reporting(E_ALL&~E_NOTICE);
	
	//通过系统函数完成临时转换
	
	$var = '4king';
	
	$res  =intval($var);
	
	var_dump($res);
	
	/*
	 * 
	 * PHP Fatal(致命错误) error:  Call to undefined function realval() in I:\WWW\PHPjicurumen\type-4.php on line 14
	 * 
	 * 调用了未定义的函数realval()
	 */
	
	var_dump(floatval($var),doubleval($var));
	
	var_dump(boolval($var));
	
	$var=true;
	
	var_dump(strval($var));
	
?>


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!