top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the use of @ putting against a variable in PHP?

+4 votes
351 views
What is the use of @ putting against a variable in PHP?
posted Dec 1, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

@ is a error control operator means if variable or index (in case of array is not defined) you will not receive the error or warnings. For more details please look at -

http://php.net/manual/en/language.operators.errorcontrol.php

answer Dec 1, 2013 by Sanketi Garg
Similar Questions
0 votes

PHP:: Suppose I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, whats the problem?

+1 vote

I have a code in PHP something like this

 if (strlen($profile['current-employer']) == 0)
     break;
 else
     return a;

Now in some cases $profile['current-employer'] can be non-existent, now here my question is in the case of non-existent variable what strlen will result... (This is related with QueryHome code)

0 votes

Have two questions -
1. How to find type of a variable in PHP.
2. How to find the type of an array in PHP.

Please help.

+2 votes

I'm having a problem getting my objects out of the $SESSION variable. I am storing an ordinal array of associate arrays where one of the associate array elements is an object. Unfortunately, when I pull it back out, the object is "broken" with "__PHP_Incomplete_Class" errors.

From what I can read this has something to do with 'serialization' - i.e., the emerging object must be unserialized (http://php.net/manual/en/function.unserialize.php ). However, I can't get it to work.

Any tips on how that is done, or what I should do instead?

This program is being developed on a testing server that can then be put on a production server.

Here are my server specs:
Apache Version : 2.2.17
PHP Version : 5.3.3
MySQL Version : 5.5.8

+3 votes

Say I have sent a command to a process using the fwrite command something like

...
while (true) {
 switch (expect_expectl($stream, $cases)) {
 case "ls":
 fwrite($stream, "ls -aln");
 break;
..

Is there a way I can save the output from that process to a variable ?

...