How do we determine which user the php script is running under when I run the script on server? Is it running under the same user as apache or phpmyadmin by chance? My quest
Use this:
echo get_current_user();
Make sure to read the comments because it looks like this answer doesn't actually do what you want.