PCuser Posted November 21, 2020 Share Posted November 21, 2020 I'm trying to get a field value and sanitize it before outputting the value. In this case I want to retrieve the page title and then use it as the id for the container element (sanitizing to remove spaces/uppercase). Example (doesn't work): <? foreach($pages->find("template=sportspage, sort=random") as $sportspage) : ?> <div id="<?= $sanitizer->$sportspage->title; ?>"> </div> <? endforeach; ?> I'm not that used to PHP and formatting particularly with foreach loops so the documentation isn't really helping. Thanks Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now