Keyword

How to know if the word limit is exceeded

  • Mike Economou
  • Mike Economou's Avatar Topic Author
  • Offline
  • Junior Member
More
7 years 1 month ago #161080 by Mike Economou
How to know if the word limit is exceeded was created by Mike Economou
Hi,

I am trying to show the read more button, only if the word limit is exceeded or if there is fulltext.
The part with the fulltext is working finr but I could not found a param or something that indicates this.

So what I tried to do was to strpos for the "..." in the introtext.
And here comes the problem, the strpos always returns false and wil searching I discovered that the problem was the enconding (utf8mb4).

I tried mb_strpos,
I tried mb_strpos($this->item->introtext, "...", 0, 'UTF-8')
I striped tags from the introtext.

No matter what I do I get false.

Anyone has any idea hoa to do that ?

Thank you

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 4 weeks ago #161151 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to know if the word limit is exceeded
You can try using the php.net/manual/en/function.str-word-count.php function.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Mike Economou
  • Mike Economou's Avatar Topic Author
  • Offline
  • Junior Member
More
7 years 3 weeks ago #161203 by Mike Economou
Replied by Mike Economou on topic How to know if the word limit is exceeded
Thank you Krikor

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 3 weeks ago #161243 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to know if the word limit is exceeded
You 're welcome :)

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum