[PHP] How to start a global variable within a function?
as title, how to start a global variable within a function?
[PHP] How to start a global variable within a function?
as title, how to do that? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to start a global variable within a function?
as title, how to do that? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to start a global variable within a function?
but, I mean I haven't start the global variable BEFORE the function is called... "Jasper Bryant-Greene" <[EMAIL PROTECTED]> wrote:[EMAIL PROTECTED] > $someGlobalVariable = 'foo'; > > function myFunction() { > global $someGlobalVariable; > > // do stuff with $someGlobalVariable > } > ?> > > Jasper > > Wong HoWang wrote: >> as title, how to start a global variable within a function? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to start a global variable within a function?
but, I mean I haven't start the global variable BEFORE the function is called... "Jasper Bryant-Greene" <[EMAIL PROTECTED]> wrote:[EMAIL PROTECTED] > $someGlobalVariable = 'foo'; > > function myFunction() { > global $someGlobalVariable; > > // do stuff with $someGlobalVariable > } > ?> > > Jasper > > Wong HoWang wrote: >> as title, how to start a global variable within a function? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to start a global variable within a function?
That is something like: Can I write like this? "Jasper Bryant-Greene" <[EMAIL PROTECTED]> wrote:[EMAIL PROTECTED] > $someGlobalVariable = 'foo'; > > function myFunction() { > global $someGlobalVariable; > > // do stuff with $someGlobalVariable > } > ?> > > Jasper > > Wong HoWang wrote: >> as title, how to start a global variable within a function? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] curl?
Hi, Everybody! I got this when I execute the script: Fatal error: Call to undefined function: curl_init() in msnp9.class.php on line 259 is there anyway to solve it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem when encoding non-english into UTF-8
Dear all, When I try to encode non-english char. such as big5 to UTF-8 with utf8_encode(), it always generate a wrong result, which is not readable. What can I do? Please help! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Super globals ?
Dear all, Hello, I want to know that is there any way to create a super global in PHP? Please help! Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Super globals ?
Dear all, Hello, I want to know that is there any way to create a super global in PHP? Please help! Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Super globals ?
yes, I am asking how to start my own super global... And even a PHP beginner know that $GLOBALS is a array containing all the global variables and it is used in a function or a class. So I think no one will ask a question here which the answer is simply $GLOBALS. Any finally, thanks Jasper for the answer. "Jasper Bryant-Greene" <[EMAIL PROTECTED]> wrote:[EMAIL PROTECTED] > Kevin Waterson wrote: >> This one time, at band camp, Jasper Bryant-Greene >> <[EMAIL PROTECTED]> wrote: >> >> >>>Because he asked for superglobals, not globals. $GLOBALS (not $_GLOBALS) >> >> meh, force of habit >> >>>happens to be an example of a superglobal. >> >> >> and variable can be set within its scope, so why not use it? >> As we see in the manual at $GLOBALS _is_ a super global and available >> to all scopes within the script. >> http://www.php.net/manual/en/reserved.variables.php#reserved.variables.globals >> it refers to $GLOBALS as " This is a 'superglobal', or automatic global, >> variable. " >> >> gotta love the php manual > > Exactly Kevin. What the OP wanted was to create another superglobal, just > like $GLOBALS. The contents of $GLOBALS refer to the global variables, > which are *not* all superglobals. The only superglobals by default in PHP > (apart from $GLOBALS) are $_SERVER, $_GET, $_POST, and so on. > > He asked a question, and I provided the answer. Why he wants to do it is > another question, but telling him to "use $GLOBALS" isn't answering his > question, it's answering a different question, namely how to access the > global variables. > > Jasper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help: Get the value of pi up to 200+ digits?
Dear all, I'm trying to do like this but failed: How can I get more digits after . ? Can anyone help? Thx! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help: Get the value of pi up to 200+ digits?
Dear all, I'm trying to do like this but failed: How can I get more digits after . ? Can anyone help? Thx! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help: Get the value of pi up to 200+ digits?
but my server configure don't have bcmath enabled, is there any other way to do so? "Torgny Bjers" <[EMAIL PROTECTED]> wrote:[EMAIL PROTECTED] > Wong HoWang wrote: >> Dear all, >> >> I'm trying to do like this but failed: >> >> > ini_set('precision',16); >> echo pi(); >> ?> >> >> How can I get more digits after . ? > > I am fairly sure that you have to use BCMath for this: > http://www.php.net/manual/en/ref.bc.php > > Give it a go and see what happens! :) > > Regards, > Torgny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help: Get the value of pi up to 200+ digits?
Dear Jordan, I know what you mean. But you may try this one and you will know: the result is the same as 16!!! So that's why I ask this question! I am not stupid like that! Please help, thx! "Jordan Miller" <[EMAIL PROTECTED]> wrote:[EMAIL PROTECTED] > http://us3.php.net/manual/en/ini.core.php#ini.precision > > precision sets the number of significant digits, *NOT* the number of > digits displayed after the decimal point. > > If you want to get pi out to 16 decimal places you need a precision of > *17* because the beginning 3 is a significant digit. > > Your code does exactly this, displaying pi with 15 decimal places. > > Jordan > > > > On Sep 1, 2005, at 8:06 AM, Wong HoWang wrote: > >> Dear all, >> >> I'm trying to do like this but failed: >> >> > ini_set('precision',16); >> echo pi(); >> ?> >> >> How can I get more digits after . ? >> >> Can anyone help? Thx! >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> >> >> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Saturdays and Sundays
the answer is simply yes! You can have a simple for looping to do so. hope this help! ""Shaun"" <[EMAIL PROTECTED]> wrote:[EMAIL PROTECTED] > Hi, > > Is it possible to get the number of saturdays and sundays for a given > month / year? > > Thanks for your help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] disable safe_mode with .htaccess ?
Hello everyone, I have a special question and want to ask here, hope anyone can answer me. My server is Apache/1.3.33 with PHP/4.3.10 I have AllowOverride All in my httpd.conf and safe_mode = On in php.ini , I want to turn off safe_mode in one folder by .htaccess , is it possiable? I don't want to make changes to my httpd.conf or php.ini because that is a productive server and shouldn't restart it. Please help, thank you! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] owner of files created by fopen() become wrong?
Hi all, I am so sorry that I have a lot of questions... This time I got a special issue... I have set up a VirtualHost for the domain that have problem. Since I am using Apache/1.3.33 , I have set the User & Group inside & outside the ... tags. As you know, the user & group set outside VirtualHost will be the user & group that the main server run with. And the one inside will be used for that domain only. The question comes, when I trying to run a script that use fopen('.xxx','w'); to create a file(or even create a dir), the file owner & group is 'apache', that is the user & group I run apache with, but NOT the one inside the !!! I have tried to restart my server and make sure the httpd.conf loaded corrrectly, but the question is still there, can anyone tell me how to solve this problem? Plesae help! Thx! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php