Drupal 7 Is the a way to programmatically know the Fields in a Content Type? In Drupal 7, i need to Programmatically create the nodes, by using:

$node = new stdClass();
$node-&gt;type = "movie";


After, just this codes above, and lets assume i don't know what are the fields for it.


How can i get to know the fields and that field's structure for this Content Type?
(or) Can i echo out the fields inside a Content Type and its relations ?
field_info_instances(); will get you a list of all field types on a specific entity/bundle.

For example:

$fields = field_info_instances('node', 'movie');
print_r($fields);


Will give you a list of all available fields on the node type of movie.