我一直在尝试使用键和值来设置数组,但似乎无法让我的代码正常工作。我的阵列的一个例子是如下...从现有阵列创建键值数组(使用Substr)
array(4) {
[0]=>
string(23) "Dry Traction 4 out of 5"
[1]=>
string(23) "Wet Traction 4 out of 5"
[2]=>
string(34) "Steering Responsiveness 4 out of 5"
[3]=>
string(22) "Noise Level 3 out of 5"
}
随着这阵,我使用SUBSTR(),以单独的数字(最后10个字符),但想的字符串的第一部分成为关键。我SUBSTR代码如下...
foreach($array as $item) {
$value = substr($item, -10);
}
我觉得可怕的问,因为我想这出我自己,但我真的很感激任何和所有帮助!
非常感谢!