PHP strval() 函数

PHP 教程 · 2019-01-31 21:42:24

strval() 函数用于获取变量的字符串值。

PHP 版本要求: PHP 4, PHP 5, PHP 7

语法

string strval ( mixed $var )

参数说明:

  • $var: 可以是任何标量类型,但不能是数组或对象。

返回值

返回字符串。

实例

实例

<?php $int_str= 123; var_dump($int_str); $str = strval(123); var_dump($str); ?>

输出结果为:

int(123)
string(3) "123"

点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Practical Django Projects, Second Edition

Practical Django Projects, Second Edition

James Bennett / Apress / 2009 / 44.99

Build a django content management system, blog, and social networking site with James Bennett as he introduces version 1.1 of the popular Django framework. You’ll work through the development of ea......一起来看看 《Practical Django Projects, Second Edition》 这本书的介绍吧!

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具