How do I use PHP code in a block? I am new to Drupal 8. I am building a website with Drupal 8, and it has many blocks contain images. They have an absolute path for the src attribute right now. I would like to make them dynamic base on the base URL, but there is no text format support PHP code anymore for security reason. Is there a safe way to achieve this?
PHP filter is a core module in Drupal 7 but in Drupal 8 it is removed because of some security reason but still you can use this module PHP.

Note: Enabling this module can cause security and performance issues as it allows users to execute PHP code on your site.