PHP中将字符串转化为整数(int) intval() printf()

int

1 <?php 
2 $foo = "1"; // $foo 是字符串类型 
3 $bar = (int)$foo; // $bar 是整型 
4 ?>

intval

1 <?php 
2 $foo = "1"; // $foo 是字符串类型 
3 $bar = intval($foo); // $bar 是整型 
4 ?>

sprintf

1 <?php 
2 $foo = "1"; // $foo 是字符串类型 
3 $bar = sprintf("%d", $foo); // $bar 是字符串类型 
4 ?>
微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_698.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?