Anyway to exclude a portion of a PHP include?

Good morning,

I would like to use a php include here. But exclude (not show) a large portion of it on certain pages. And only show a specific to each page portion. Anyway to do this with php aside from display none css? Thanks.

You could put a variable on each page and check what the variable is and only show the relavant code.

You could read the page name from the URL and again only show the relavant result from the include.