I've been struggling with this problem for some hours and I can't find a solution. I usually don't ask for help on forums but this time I just feel helpless... so I would really appreciate your suggestions.
I'm working with a CMS (MODx) and in one point I'm sending a document ID:
Code: Select all
[!anythingRating? &atrGrp=`Articles` &define=`1`!][!anythingRating? &atrGrp=`Articles` &atrId=`[*id*]`!]Code: Select all
$cfg['atrId'] = isset($atrId) ? $atrId : 0;Code: Select all
function printStringCharacters($str) {
print "string: [$str] ";
$c = strlen($str);
print '[';
for($i = 0; $i < $c; $i++) {
print ord(substr($str, $i, 1)).' ';
}
print "] ";
var_dump($str);
}When I open different documents:
Code: Select all
http://<my_domain>/147
http://<my_domain>/231
http://<my_domain>/232Code: Select all
string: [147] [91 42 105 100 42 93 ] string(6) "147"
string: [231] [91 42 105 100 42 93 ] string(6) "231"
string: [232] [91 42 105 100 42 93 ] string(6) "232"I tried to manually encode "147" number and what I could get is:
Code: Select all
string: [147] [49 52 55 ]
string: [?1?4?7] [0 49 0 52 0 55 ] (UTF-16)
string: [147] [49 52 55 ] (UTF-7)
string: [147] [49 52 55 ] (EUC-JP)
string: [147] [49 52 55 ] (SJIS)
string: [1?4?7?] [49 0 52 0 55 0 ] (UCS-2LE)
string: [147] [49 52 55 ] (JIS)
string: [147] [49 52 55 ] (eucjp-win)
string: [147] [49 52 55 ] (sjis-win)It wouldn't bother me if not the SQL query which works with '147' for example but doesn't work with $cfg['atrId'].
Thanks,
Mateusz Sobczak