Edward Ver Posted April 25 Share Posted April 25 Hello everyone, I made a search page and it's working fine. But, I want to truncate the output the textarea of the search result text. I want to limit the output of the "maintext" in the result page. Thanks in advance. echo "<div class='summary'>$match->maintext</div></li>"; Link to comment Share on other sites More sharing options...
psy Posted April 25 Share Posted April 25 There are several ways to truncate text. In CSS, see https://developer.mozilla.org/en-US/docs/Web/CSS/text-overflow In PHP, https://www.php.net/manual/en/function.substr.php In ProcessWire, https://processwire.com/api/ref/sanitizer/truncate/ Number 3 is my choice Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now