How can I echo something only if the woo-commerce product id is listed in my array?

If you want to know if the product exists in that array, we can simply do an isset() to check it:

Change

&& get_the_id() == 226 

to

&& isset($booking[get_the_id()])

That will evaluate as true if there is an array element with that ID as key