php4 compatible solution..