(Photo diode) for power meter question

Hi Everbody

I have i photodiode, that i used before that was incuded with a energy-metering Product Now, my question, the diode has two "legs" can i use it both for analog and digital input?

Is there any Arduino-code around here the i can test my diode?

Thanx

/Trident

LIGHT SENSING TUTORIAL WITH PHOTODIODE