Recently, I’ve been doing a lot of work with XML and json. One small problem I ran into was assigning SimpleXML variables to a class variable and then running it through json_encode:
“pageLength”:{”0″:”10″}
The simple solution I came up with, but which were not readily apparent in the documentation is that you need to simply cast the SimpleXML variable to a string or int.
$object->pageLength = (int)$xml->element;
which produces this json:
“pageLength”:0
Hope this helps someone else save some time.
23 Nov 07 6:11 pm
This has nothing to do with this post, but everything to do with the IE problems you have been having with your css (post below)
This is my bestest friend in the whole wide world. Meet universal reset:
* {
margin: 0px;
padding: 0px;
left: 0px;
top: 0px;
right: 0px;
bottom: 0px;
}
This fixes those cross browser compatibility issues (with layouts) by resetting everything to 0 on each browser (since each browser comes with it’s own set of thoughts about how big a margin should be). I am a web developer myself, and have had great success with this little guy.