Pudong airport

Hi, I'm arriving at pudong next saturday, late night, around 11:45pm, I guess with the checkout and stuff it will be too late to head to a hotel, and maybe a bit dangerous for a foreigner (first time there). Do you think it is ok to stay there at a terminal until early morning?

book a hotel near the airport that offers free shuttle service.  Give them your flight information they should pick you up.  I would not worry. Shanghai is pretty safe. Or just get in a normal taxi and not one of the illegal ones.

Why would it be dangerous?  If you have a hotel booked, you can check in late.  They don't mind since you're paying for a day you're mostly not using.