IS_RESOURCE(3) 1 IS_RESOURCE(3)is_resource - Finds whether a variable is a resourceSYNOPSIS
bool is_resource (mixed $var)
DESCRIPTION
Finds whether the given variable is a resource.
PARAMETERS
o $var
- The variable being evaluated.
RETURN VALUES
Returns TRUE if $var is a resource, FALSE otherwise.
EXAMPLES
Example #1
is_resource(3) example
<?php
$db_link = @mysql_connect('localhost', 'mysql_user', 'mysql_pass');
if (!is_resource($db_link)) {
die('Can't connect : ' . mysql_error());
}
?>
NOTES
Note
is_resource(3) is not a strict type-checking method: it will return FALSE if $var is a resource variable that has been closed.
SEE ALSO
The resource-type documentation, get_resource_type(3).
PHP Documentation Group IS_RESOURCE(3)
Check Out this Related Man Page
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)
Hi all,
I'm just learning to write shell scripts (new to the whole UNIX thing) and I'm wondering if anyone would like to help me create a resource to help me, and others like me, learn scripting. It would be something like "100 interesting shell scripting problems".
All I need are... (7 Replies)
have been trying to create a 2 GB ramdisk (virtual) to run on my T-2000 simulator (Legion) which has sun4v architecture. I have a SPARC workstation which runs on sun4u architecture with Solaris 10.
I have created a ramdisk image using dd command, newfs, then used ufsrestore to restore the... (3 Replies)
I have an application that routinely alloc() and realloc() gigabyte blocks of memory for image processing applications; specifically performing rotations of huge images, or creating/ deleting huge image buffers to contain multiple images. Immediately upon completion of an operation I call free() to... (9 Replies)
Trying to get the IP address of the HMC connected to some servers running AIX 6 and 7. I thought this would be as easy as running 'lsrsrc IBM.MCP IPAddresses', but when I run that command, the resource is empty. Is there some where else I should be looking, or is there a reason why this resource... (5 Replies)
Hi,
Using ksh, I have set up aliases (which work fine) in my user's .profile like this:
alias ll = 'ls -lrt'
alias cls = 'clear'
How do I call these same aliases so that they will work after issuing this: ? su - user
I do not want to add aliases to the su shell's .profile or .kshrc. (7 Replies)
We have a user where a process is behaving abnormally and crashing. It would be great if a core file was generated, but I don't see one.
user101671:/apps/ -$lscore -d
compression: on
path specification: on
corefile location: /opt/core
naming specification: off
There is no core file being... (3 Replies)
I was wondering how can I find the culprit of a slow shutdown on my debian box? I am actually looking for a diagnosis tool that might dump the process name and amount of time it took to close the process after signal was send.
As for now I am trying to use journalctl to seek some information,... (5 Replies)
Good evening, need your help please
Need to delete certain files before octobre 1 2016, so need to know how many files im going to delete, for instance
ls -lrt file_20160*.lis!wc -l
but using grep -c to another file called bplist which contains the list of all files backed up doesn match... (7 Replies)
Good evening, i need your help please
I will try to describe the scenario briefly: In a Telecom Production system application receives a certain files called CDRs(call detail records) to be processed by doing some operating systems operations and then database operations like creating indexes... (4 Replies)
I have 4000 files like
$cat clus_grp_seq10_g.phy
18 1002
anig_OJJ65951_1 ATGGTTTCGCAGCGTGATAGAGAATTGTTTAGGGATGATATTCGCTCGCGAGGAACGAAGCTCAATGCTGCCGAGCGCGAGAGTCTGCTAAGGCCATATCTGCCAGATCCGTCTGACCTTCCACGCAGGCCACTTCAGCGGCGCAAGAAGGTTCCTCG
aver_OOF92921_1 ... (1 Reply)
Hi All,
Is there any way I can prioritize my VMs when there is resource crunch in host machine so that some VMs will be allocated more vcpu, more memory than other VMs in kvm/qemu hypervisor based virtual machines?
Lets say in my cloud environment my Ubuntu 16 compute hosts are running some... (0 Replies)
Hi,
I have a script below that is running ssh <host> <command> on some servers.
Below is more or less the script. I have to modify it somehow to get rid of the 'confidential' hostnames
check_log.bash
#!/bin/bash
#
myPID=$$
parse_log ()
{
sub="parse_log"
host=${1}
... (2 Replies)
In HA platforms, there is the concept of a "Scalable Resource Type, which included the sharedaddress" that is used in commonly Web Servers resource groups. The sharedaddress resource type is provided so a developer can use this Resource type to build their own scalable resource group. I see... (1 Reply)