Fatal error: Call to undefined function mb_substr()

I wanted to see your input on this concern I'm currently experiencing. It turns out that:

 <?php
$disc_t=$name; 
  if(strlen($disc_t)<=15)
  {
   $name_now=mb_substr( strip_tags($disc_t), 0, 10 ).'';
  }
  else
  {
   $name_now=mb_substr( strip_tags($disc_t), 0, 10).'...';
  }
?>

is somehow giving me an error on the site, the error shows:

Fatal error: Call to undefined function mb_substr() in /home/(website)/public_html/index.php on line 308

I don't quite understand what they mean by mb_substr, is this a PHP version error? I am currently using PHP 5.3.19

Answers


Throw this into a terminal:

php -m | grep mb

If mbstring shows up then it should work.


mb_substr() is a multibyte-safe version of substr(), meaning it works with characters as opposed to bytes. This is most noticeable in UTF-8, where many characters are represented by two or more bytes.

According to the installation instructions, mbstring is not a built-in extension. You must enable it by having the appropriate files and configuring PHP correctly. Some information can be found in the link provided, your webhost should be able to help you with the rest.


Need Your Help

Rails Ajax Not Working in Firefox

javascript jquery ruby-on-rails ajax firefox

I have a Rails app that uses an ajax call to (right now) get a JavaScript alert message. It works in Safari and Chrome, but not in Firefox (all current versions). I can step through the code in Fir...

ExtJS Tree same parentNode

ajax extjs tree

I am rendering a Tree using Jason array that i get from a jsp page. So the tree has root node and 3 nodes and each node has more than 5 children and some of the children has same id and same text. It

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.