Sahal
Sahal

Reputation: 4136

How to check php_ini variables are set?

I am overriding php.ini variables in my code. (ini_set("memory_limit", -1);)

How can i make sure it is set. Am using windows machine.

Is there any way i can read variable by variable with some GLOBAL array or something ?

Once i set variable, i want to read it in the next line for testing.

Upvotes: 1

Views: 489

Answers (4)

Rakesh Sankar
Rakesh Sankar

Reputation: 9415

Adding an live example

<?php

echo ini_get("memory_limit");

?>

Output:
128M (based on the value set in your php.ini).

Please see the link below for working example:

http://codepad.org/vm6iVDVj

Upvotes: 0

Paul.s
Paul.s

Reputation: 38728

Is this what you are after? PHP manual

Upvotes: 0

borrible
borrible

Reputation: 17336

Use the function ini_get.

Upvotes: 2

Sebastian Schmidt
Sebastian Schmidt

Reputation: 1078

You can use ini_get('memory_limit');

Upvotes: 1

Related Questions