How to restrict access using the do_shortcode function in php?


I am writing a post template in php. In that one, I would like to restrict a part of the post using my [level-premium] shortcode. I cannot get this to work using php.

Basically I need to do:

echo do_shortcode('[level-premium]');

*** A lot of content and use of other shortcodes ***

echo do_shortcode('[/level-premium]');

I have understood that this is not how it works to call a shortcode with content using PHP, but can someone help with how to do it?