Sanitization

This script updates the users and user_location tables to replace sensitive data like phones number, names, addresses by 'hidden'.
The update request on users table is split in smaller requests of 500 lines each to avoid the server to cut the connexion.
The update of user_location is done in one request as every field is replaced by the same value.

I wasn't clear in my email about unserializing : 

In order to get the data contained in the data field of the users table, I have to use the unserialize function, which fails on 8425 (out of 37601) users. It doesn't prevent the script to work but I just cannot access the data, I looked closely to several user's data and there is just nothing wrong there, sometimes it would work after I deleted a portion of text, apparently it would be en encoding problem (even though the text I had deleted didn't contain any special characters) but I havent found any solution to it.
So my question was, what do we do with these users's data ?
Right now the script just recopy the serialized data (line 106) to avoid a null value, so the sensitive informations are not hidden.
As I read, the function could also work fine on your server...

I haven't seen the other scripts you told me, I could base the data on the user id if you need it (?)

The big array in comment is for the case we would want to replace the not unserializing data with default values.

ps : and there is probably some efficiency improvements to do, the script takes a minute to terminate on my slow machine, I have no idea if it can be seen as slow or fast :)

ps2 : After I had a look to change-user-emails.php I guess this script will be used in the rebuild process right ? so it might be better to use drush instead ?