How to run PHP code only once on node creation? I'm using Drupal 7, and the Computed Field module.
I want to run code just once, when the node is created.  

Is there any specific function?
If you want to run code just once when a node is created, the Rules module may be a better choice.

Using Rules, you can do the following:


Create a new rule that acts on the event "After saving new content."
As the action, "Set a data value" and target the field you want to modify (this would be a standard field rather than a computed field in this case).
As the "Value", input your PHP code in php tags.


This way the code will be evaluated only once.