PHP conditional handler for jQuery Conditions