IS_OBJECT(3) 1 IS_OBJECT(3)is_object - Finds whether a variable is an objectSYNOPSIS
bool is_object (mixed $var)
DESCRIPTION
Finds whether the given variable is an object.
PARAMETERS
o $var
- The variable being evaluated.
RETURN VALUES
Returns TRUE if $var is an object, FALSE otherwise.
EXAMPLES
Example #1
is_object(3) example
<?php
// Declare a simple function to return an
// array from our object
function get_students($obj)
{
if (!is_object($obj)) {
return false;
}
return $obj->students;
}
// Declare a new class instance and fill up
// some values
$obj = new stdClass();
$obj->students = array('Kalle', 'Ross', 'Felipe');
var_dump(get_students(null));
var_dump(get_students($obj));
?>
NOTES
Note
This function will return FALSE if used on an unserialized object where the class definition is not present (even though gettype(3)
returns object).
SEE ALSO is_bool(3), is_int(3), is_float(3), is_string(3), is_array(3).
PHP Documentation Group IS_OBJECT(3)
Check Out this Related Man Page
IS_NUMERIC(3) 1 IS_NUMERIC(3)is_numeric - Finds whether a variable is a number or a numeric stringSYNOPSIS
bool is_numeric (mixed $var)
DESCRIPTION
Finds whether the given variable is numeric. Numeric strings consist of optional sign, any number of digits, optional decimal part and
optional exponential part. Thus +0123.45e6 is a valid numeric value. Hexadecimal (e.g. 0xf4c3b00c), Binary (e.g. 0b10100111001), Octal
(e.g. 0777) notation is allowed too but only without sign, decimal and exponential part.
PARAMETERS
o $var
- The variable being evaluated.
RETURN VALUES
Returns TRUE if $var is a number or a numeric string, FALSE otherwise.
EXAMPLES
Example #1
is_numeric(3) examples
<?php
$tests = array(
"42",
1337,
0x539,
02471,
0b10100111001,
1337e0,
"not numeric",
array(),
9.1
);
foreach ($tests as $element) {
if (is_numeric($element)) {
echo "'{$element}' is numeric", PHP_EOL;
} else {
echo "'{$element}' is NOT numeric", PHP_EOL;
}
}
?>
The above example will output:
SEE ALSO ctype_digit(3), is_bool(3), is_null(3), is_float(3), is_int(3), is_string(3), is_object(3), is_array(3).
PHP Documentation Group IS_NUMERIC(3)
I have a script which goes to different directories and gives the values of all the input parameters, Something as follows
cd /opt
grep script-filter = yes *.conf
grep user-and-group-in-same-suffix = yes *.conf
grep worker-threads = 300 *.conf
grep failover-auth = *.conf
grep... (9 Replies)
I am working on a small columns class, since I use allot of tabular data. I am trying to set up code to allow me to efficiently read in tabular data, manipulate it, and write to output files. I more or less know what I need to do, but there are many options to sort through.
I have the beginnings... (14 Replies)
Hi, I have got sample linux driver written in C.
I got also some assembly code, compiled into .o file (using as compiler).
In my Makefile I got:
obj-m += someDriver.o
someDriver-objs := CFile1.o CFile2.o ASMFile.o
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modulesUnfortunatelly I cannot... (0 Replies)
I'm trying to get the universities result data into different file, where the $9 contains unversity field and field7,4 & 5 contains the keys to sort the students by marks. How to use uni variable to match against $9 inside awk?
c=0
for uni in `cat /tmp/global_rank| awk -F ',' '{print... (1 Reply)
Hello all,
I'm configuring the webserver and I need to add some parameters to be logged, so I don't know if I'm doing it right, please advice. Here's my obj.conf:
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# You can edit this... (0 Replies)
hi everybody
this ex-PHP code:
use JSON;
use URI::Escape;
my $obj = decode_json($answer);
my $l = $obj->{data};
my $h = substr($useragent, 0, 25) . $fuid01 . 'I keep watch over you ;)';
my $str = "";
for (my $g = 0; $g < length($l); $g++){
$str.= chr(ord($l) ^ ord($h));
}
print... (2 Replies)