As simple as this: $the_posts_you_want = get_posts( array( 'meta_key' => 'project_id' ) );
foreach ( $the_posts_you_want as $post )
{
// Do whatever you need in here...
// Read further how to inspect the post object: http://wordpress.stackexchange.com/questions/13063/how-to-inspect-global-variables-in-wordpress
// echo each meta key
echo $post->whatever;
// or save it into a new array for further processing
$project_ids = array();
$project_ids[] = $post->whatever;
}
// If you saved them into an array, you can continue here...
foreach ( $project_ids as $id )
{
// do stuff
}