mb_detect_encoding() - is this native to php 4 or 5

Posted on 2009-02-16
Last Modified: 2012-05-06
Hello, I'm trying to use this function but on the server that I am using it on it's giving me this error:

Fatal error: Call to undefined function mb_detect_encoding() in D:\Domains\\wwwroot\SuperCon2\class.myrssparser.php on line 184

What is the requirements for using this function. I thought that this function was inherited in php 4 or php 5. Is there any other setting on the server I need to know because on my other server it works just fine
Question by:DancingFighterG
    LVL 107

    Expert Comment

    by:Ray Paseur

    The extension is probably not installed on PHP

    Author Comment

    I think that they installed an activiated the extension but I'm still getting the same error:
    LVL 107

    Accepted Solution

    See the code snippet.  I don't think you have the "short tags" thing set.  So instead of saying <? you will need to say <?php
    <?xml version="1.0" encoding="iso-8859-1"?> 
    <body bgcolor="#FFFFFF">
      		    # where is the feed located?
                    $url = "";
                    # create object to hold data and display output
                    $rss_parser = new myRSSParser($url);
                    $rawoutput = $rss_parser->getRawOutput();
    				# returns string containing HTML
                    $items = $rawoutput['RSS']['CHANNEL'][0]['ITEM'];
    	         for($i=0; $i<8; $i++) {
                        <div align="left"><a href="<?=$items[$i]['LINK']?>" title="<?=strip_tags($items[$i]['TITLE'])?>" target="_blank"> 
                      <div align="left"> 

    Open in new window


    Author Comment

    I will try this out tonight but I think you are right and it might work

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Both Easy and Powerful How easy is PHP? (  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
    Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to dynamically set the form action using jQuery.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now