以下数组在打印时显示$career2的值为2010-。
然而,无论我怎么尝试,这个if方程都不会触发。这些数组变量在某些方面会有所不同吗?
echo $career[2];
if($career[2] == "2010-"){
$career = $career[1];
} 数组$career的print_r揭示了这一点。
Array (
[0] => BIS career
[1] => CEO of the corp
[2] => 2010-
[3] => Leader of R&D
[4] => 2005-10
);VAR转储
array(11) {
[0]=> string(316) "BIS career "
[1]=> string(194) " CEO of the corp "
[2]=> string(163) " 2010- "
[3]=> string(160) " Leader of R&D "
[4]=> string(165) " 2005-10 " }发布于 2015-05-15 22:51:08
您还可以执行以下操作:
echo "...".$career[2]."...";它将反映空间
尝试:
preg_replace('/^[\pZ\pC]+|[\pZ\pC]+$/u','',$str);https://stackoverflow.com/questions/30262430
复制相似问题