Categories
Computing Web Development

PHP 4 Stinks – Reason Number 3008

PHP sucks ass in a tremendous way.

So I am parsing an XML file with PHP.
The xml file has an element like:
<element>this-is-the-data</element>

Any language worth two cents would return the CDATA of this element as:
this-is-the-data

But PHP – no.

Its native parser – a really fast SAX parser – calls the CDATA handler multiple times, but not in a consistent fashion (for real) – so you cannot just use a call like
$x = $data;
where $x is some variable and $data is the character data the event returned. This will occasionally overwrite $x with the current partial data returned from the parser.
You must use
$x .= $data
which means – “append to $x”.

How f-n stupid is that?! And is this documented ANYWHERE?!!!!!
No.
PHP is enterprise ready like Clay Aiken is straight.

Share
Categories
Web Development

IE and min-height – conquered

Sometimes when you float an image (or a div) inside another div, it may be too big for its container. min-height can correct the problem in Firefox, but with IE, a different approach is necessary.

IE essentially ignores min-height if it appears anywhere outside of a table and Microsoft is very clear about it, which is just so nice.

The solution suggested in a comment on this page is:
Set the style on the containing div to have these properties and it will expand as necessary:
overflow: auto;
and then either
height: 100% or width: 100%;

Share
Categories
Web Development

PHP is not for me

So I was chasing my tail today doing some PHP work (deadline way tight, of course!) only to find out that the bloody weakly typed language allows instantiated a variable because I did not use its global construct to tell it to use the variable of the same name that is external to the method. Argh!
So yeah, mind your globals.

Share
Share