0
我一直希望得到一些想法/帮助与PHP。
我使用下面的代码返回一个值,在我的情况下,它的值是十六进制的十进制数字612B。我需要翻转2B和2B61。PHP分割结果
$skillsearch1 = odbc_exec($conn1,"select cast(cast(reverse(substring(strevent, 1, 1))as varbinary)as int) from USER_EVENT where strUserID='loneranger'");
$skillfound1 = odbc_result($skillsearch1,1);
谢谢。
编辑1:
其中
str_split($test, 2)));
我不得不将其更改为
str_split($test, 1)));
而且我得到了正是我想要的。 感谢您的帮助。
如果是字符串 - $ skillfound1 = substr($ skillfound1,2)。 substr($ skillfound1,0,2);'或'$ skillfound1 = preg_replace('/(\ w {2})(\ w {2})/','$ 2 $ 1',$ skillfound1);' – Cheery 2014-10-08 23:24:31