No one taought me a damn thing about this language, and I suspect that of most of the experienced coders on here. Go to php.net. Look at the manual. Look at the user comments. 99.9% of what you want to "learn", can se self-taught there.
[edit]Also, what you want to be done is not a PHP function. The whole client-side thing that you want to do can't be done in PHP. [/edit]
[edit2]And if you are really wanting to learn how to code, and haven't had much experience, you should start on something easier.[/edit2]