|
Posted by Henry on 09/19/06 19:38
On 18 Sep 2006 16:58:53 -0700, rustysmith@bellsouth.net wrote...
>
>Anyone know how to sniff out the PHP version that a current file is
>running on? This would be helpful in the instance where you are trying
>to make a package that can be distributed publicly for use in a variety
>of configurations. This code should(?) work:
>
>$ver=PHP_VERSION;
> if(ereg('^[1-4]',$ver))
> $post_ids=array_flip(&$post_ids); // Old syntax
> else
> $post_ids=array_flip($post_ids); // PHP 5+ syntax
>
>but it still throws the error:
>
>Warning: Call-time pass-by-reference has been deprecated - argument
>passed by value; If you would like to pass it by reference, modify the
>declaration of array_flip(). If you would like to enable call-time
>pass-by-reference, you can set allow_call_time_pass_reference to true
>in your INI file. However, future versions may not support this any
>longer.
>
>When executed in PHP 5.+
>
>Thanks in advance for any ideas how to make this work?
>
There's function "phpversion()" that returns the numeric value....
http://us2.php.net/manual/en/function.phpversion.php
Henry
--
Help a Community by Participating in Ours
We donate your subscription fees to the charity you choose
100% of your first month, 10% thereafter.
http://newsguy.com/charity.asp
Navigation:
[Reply to this message]
|