Use get_posts() to get an array of images (from each post)

I’m trying to access each post’s attached images (even those without an attached image, I want a string if no images.).

I’ve got the following code, which is a foreach loop, and for every post it should post the title and attachment link.

However, it posts the same title twice (because there’s two posts in the database).

$args = array( );

$get_info = get_posts( $args );

foreach ( $get_info as $x ) {
echo the_title();
echo the_attachment_link();

Would anyone know why there’s not an attachment link and that it’s posting the same title, twice?