I don't see how the php version could be the issue. It almost definitely has nothing to do with the data type. The php code looked url encoded in your code you posted earlier. I'm really not sure why or how that would happen. I'd really have to debug it directly. Are you sure the page you sent me is the page you were viewing? I see you have that code twice on the page. Does the same thing happen both places?
Why do you have that ob_start() code on the top of the page?
Would it be possible to upload the code to a server so I can debug it for you? That really would be the best option.