No, I'm not rms.![]()
No, I'm not rms.![]()
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
RMS IS USED by dolphin and ray software.
http://www.boonex.com/unity/forums/#...2009-02-02.htm
///////////////////////////////////////////////////
///// http://www.mediatutorial.web.id
///////////////////////////////////////////////////
Er, I just noticed:That's untrue. @ simply causes all errors to be ignored — the return value of the expression is not changed. That means that this:The @ symbol checks for errors (will return true if it finds errors, otherwise false).is untrue: in fact it's completely backwards. If the connection succeeds the value of mysql_connect() is truthy, so that will die iff the call succeeds.This will check to see if there are any errors in connecting to the database, if there are die Error!.PHP Code:mysql_connect('localhost', 'root', '');
if(@mysql_connect('localhost', 'root', '')){
die("Error!");
}
I said that errors were ignored, but that's not necessarily entirely true: if track_errors is enabled in the server config, the error generated by the expression will still be assigned to the global variable $php_errormsg.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
so , what is it:
&$name , on this function--> getNickName(&$p);
and what is it :
$$name
?????
///////////////////////////////////////////////////
///// http://www.mediatutorial.web.id
///////////////////////////////////////////////////
I don't know about the & in your example.
For the double $$:
$$name is a variable that has the name of the value of $name. Confusing huh?
If you do something like:
This is pretty confusing at first. And probably not something a beginner is going to use often. I've used it once for making new variables from information pulled out of a database.PHP Code:$name = 'jason'; // Simple variable
$$name = 'jason'; // Create a variable. Replace $name with it's value, jason, thus creating $jason = jason
echo "$jason"; // This outputs jason, even though we didn't type $jason = 'jason';
It's not something that anyone should use. Ever. If you find yourself using it, you're doing it wrong. Probably you would be better off with an associative array.And probably not something a beginner is going to use often.
The & in the above example makes a reference: it means that in code, those two variables are actually two names for the same thing. Performing an operation on one is the same as performing an operation on the other. For example:Making the references explicitly at calltime, which seems to be what you were doing above, works but is deprecated:Code:function brokenAddThree($n) { // $n is a new copy of $m, so this modification doesn't affect $n itself. $n += 3; } $m = 2; brokenAddThree($m); $m // 2 function workingAddThree(&$n) { // Here, $n is the same thing as $m, so modifying it also modifies $m. $n += 3; } $m = 2; workingAddThree($m); $m // 5Code:function deprecatedAddThree(&$n) { $n += 3; } $m = 2; deprecatedAddThree(&$m); // Throws a deprecation warning $m // 5
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
///////////////////////////////////////////////////
///// http://www.mediatutorial.web.id
///////////////////////////////////////////////////
@ sign is used when we want to execute any function n ignore any error that is bring produced by this function...
for instance there is any function , when we are caling that function it gives us a warning message, by using '@' sign that warning message will be discarded...
Bookmarks