get info from php.ini

peter2001
peter2001 used Ask the Experts™
on
How can i get some info from php.ini am making a installer and would like to see if the Multibyte String Support is enabled on the server how would i do this?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Phil PhillipsSenior Platform Engineer

Commented:
You can get configuration options using ini_get().

http://www.php.net/manual/en/function.ini-get.php

Author

Commented:
hi

ini_get() does not work as expected in php 5 does not return the values for me anyway.

still not sure how i would check to see if Multibyte String  was enabled  

is there another way to parse the info


Most Valuable Expert 2011
Top Expert 2016
Commented:
Hello, peter2001, Limited Member and welcome to EE.  Here are some ideas to make your use of this site more enjoyable and productive for you...

At EE, the experts exchange answers and advice for points.  If you look at the questions awaiting answers in this zone, you will see a lot of 500 point questions.  Your question is competing for the experts' attention among those high-point questions.  So as a matter of simple economics you might be able to envision which questions will get the experts' attention first.   Just a thought.

We are experts, but not mind readers.  Questions that are vague and hypothetical may not get answers that are as succinct and effective as questions that have actual URLs, complete code examples, and clearly expressed questions.  "It doesn't work" is not an error message.  Whenever possible, please provide the inputs and tell us what you want for the outputs.  Sometimes the right answer is, "Don't do that -- it doesn't work that way."

We answer questions and provide teaching examples, but we cannot build your applications for you.  If you do not understand the basics of computer science and the programming languages involved in your applications, you might be better off to hire a developer.  Often a great deal of trial and error, plus background information is necessary to get a piece of an application working.  The experts will try to help, but sometimes the only reasonable answer is, "Please read the fine manuals."

All of us who have been at EE for a while have seen questions like, "How do I do 'X' in 'Y' language, and by the way, I do not know anything about 'Y' language."  For some reason we never see anyone ask, "I want to play a piano sonata, and by the way, I have never take piano lessons."  It is no sin if you do not know a language, but it is not reasonable to think that you will learn it by asking questions in an online forum, any more than you could learn to play the piano by asking questions.  Instead your best question might be, "What are good learning resources to get a foundation in 'Y' language?"  We are glad to help with that.

Have a look at these:
http://us2.php.net/manual/en/mbstring.installation.php
http://www.php.net/manual/en/mbstring.php4.req.php
http://us2.php.net/manual/en/configuration.changes.modes.php
http://www.php.net/manual/en/function.mb-get-info.php
http://us3.php.net/manual/en/function.function-exists.php

Cordial regards, ~Ray
<?php // RAY_mb_detect.php
error_reporting(E_ALL);
echo "<pre>" . PHP_EOL;

// DETECT IF THE MULTI-BYTE STRING FUNCTIONS ARE WORKING
// MAN PAGE: http://www.php.net/manual/en/function.mb-get-info.php

if (function_exists('mb_get_info'))
{
    var_dump(mb_get_info());
}
else
{
    echo "mb_get_info() function does not exist";
}

Open in new window

Author

Commented:
thanks for your help
Most Valuable Expert 2011
Top Expert 2016

Commented:
Thanks for the points - I hope you find your use of EE to be enriching and valuable.  Best, ~Ray

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial