How to transfer variables from one function to another [closed]

Whatever happens in your function (I didn’t look deep in it) you can pass more then one parameter if you call the function

na_get_gallery_image_urls($posters_id->ID, $linker_sluger);

and use the value.
But makes it sense? Once you put an echo in a variable $galeryjka and then you echo the echo?