Here's what I'm using (on php5). It is essentially the same as original code. The changes are 1. Removed function definitions because I have php5 2. hard coded path to ad_file 3. $adline = implode(" | ", $ad_network); This same code works (validates) on another site I tried.
Sorry. Looks like I found the problem. $adline is being created too soon. Must have introduced this bug on upgrading. Will test right away.
Site validates now but it has a weight of ZERO. It is a P R 3 site. Let me read the forum and see if I'm missing something.