better tag filtering for php