Home  >  Article  >  Backend Development  >  javascript中的toString()方法,在php中有什么一样的函数吗?解决办法

javascript中的toString()方法,在php中有什么一样的函数吗?解决办法

WBOY
WBOYOriginal
2016-06-13 10:24:121081browse

javascript中的toString()方法,在php中有什么一样的函数吗?
javascript中的toString()方法,在php中有什么一样的函数吗?

------解决方案--------------------
(string)
------解决方案--------------------
strval()
------解决方案--------------------
方法有多种。

PHP code
 $cha = 36;      var_dump($cha); //int(36) $a="$cha"; var_dump($a);   //string(2) "36" $b=(string)$a; var_dump($b);  //string(2) "36"...................<div class="clear">
                 
              
              
        
            </div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn