Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

is_object(3) [php man page]

IS_OBJECT(3)								 1							      IS_OBJECT(3)

is_object - Finds whether a variable is an object

SYNOPSIS
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 string

SYNOPSIS
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)
Man Page

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

echo and new line

hi I want to display: The students are: a b c What I get from echo "The students are:" "$list" is The students are: a b c any idea? (6 Replies)
Discussion started by: melanie_pfefer
6 Replies

2. UNIX for Dummies Questions & Answers

awk command not woking

code ************ obj=test export obj file_str=`awk '{ print substr( $obj, 0, 17 ) }'` export file_str ************ This is not working... Thanks (3 Replies)
Discussion started by: w020637
3 Replies

3. Shell Programming and Scripting

Removing lines having #

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)
Discussion started by: openspark
9 Replies

4. Programming

passing object to function, columns class

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)
Discussion started by: LMHmedchem
14 Replies

5. Programming

Linking Linux Driver written in C with ASM module

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)
Discussion started by: Chrisdot
0 Replies

6. Shell Programming and Scripting

Help needed with awk external variable

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)
Discussion started by: InduInduIndu
1 Replies

7. Solaris

SunONE (webserver7) obj.conf

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)
Discussion started by: TorvusBog
0 Replies

8. Shell Programming and Scripting

PHP code to Perl plx

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)
Discussion started by: tip78
2 Replies