字符串数组并返回 [英] String to Array and Back
本文介绍了字符串数组并返回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个字符串,我如何将其转换为一个数组?
I have a string, how do I convert it to an array?
操纵该数组后,怎样才能再次把它变成一个字符串?
After manipulating that array, how do I again make it into a string?
不要在PHP字符串行为相同的方式在Java中?
Do strings in PHP behave the same way as in Java?
有没有欺骗这个?
推荐答案
在C中,字符串是在PHP中的数组
as in C, strings are arrays in php
然后
<?php
$a = "hola";
for($i=0; $i < strlen($a); $i++) {
echo $a[$i] . "\n";
}
$a[2] = "-"; // will print ho-a
?>
你想做什么操作?
what operation do you want to do?
这篇关于字符串数组并返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文