02-11-2009
how do I find the size of.....
hi all,
I am new to Php. Please tell me how do I find the size of an array?
Thanks
Last edited by zaxxon; 02-11-2009 at 02:20 AM..
Reason: Removed 2 links in case of ads
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
Can somebody PLEASE help me.
Suppose I want to find a file which has largest no of bytes in a particular directory, How do i do that.
ls -s will give the size of Blocks.
But I want the largest sized file and in bytes or KB OR MB.
tHANKS IN advanvce.
Bye
Rooh
:( (1 Reply)
Discussion started by: rooh
1 Replies
2. HP-UX
Hi,
How can find the size of the directory. If the directory has 1000 files. I want the total size of directory including all the files. the bdf command is just able to give only the volume size. It is not heling my cause. (2 Replies)
Discussion started by: truth
2 Replies
3. Solaris
hi all,
in my server there are some specific application files which are spread through out the server... these are spread in folders..sub-folders..chid folders...
please help me, how can i find the total size of these specific files in the server... (3 Replies)
Discussion started by: abhinov
3 Replies
4. Shell Programming and Scripting
My Question is
-----------------
Assume you've a directory (i.e /home/test/) which contains n number of files,
rename all the files which has byte count more than zero (0) with .bak extension.
Write shell script to achieve this output,
execute the same without using". / " in front of... (6 Replies)
Discussion started by: hgriva1
6 Replies
5. Shell Programming and Scripting
Hi,
I have to directory
/usr/inbound
-------------
10900.txt
10889.txt
109290202.txt
I need to create inbound directory
and i need to know size of these files one by one
if file size is zero i need to print message like "empty file"
Please help me how to solve this
thanks
krish. (4 Replies)
Discussion started by: kittusri9
4 Replies
6. Linux
Hello,
I need to know what is the size of centos 5 repository?
Each centos 5 repository.
1) os
2) update
3) addons
4) centosplus
5) extras
Here is the website link mirror.centos.org
thanks (2 Replies)
Discussion started by: email-lalit
2 Replies
7. Shell Programming and Scripting
hi,
i am using korn shell...............
Any one please help me in solving the below question:
question: i need to find the size of the directory alone...
let us assume /root/kamal/hash1 is the directory, now i want to find the hash1 size ..
... (7 Replies)
Discussion started by: G.K.K
7 Replies
8. Shell Programming and Scripting
Hello everyone,
I would like to filter and search for files in my curr dir where the blocks used by those files are over a certain number (i.e. 30), when I try this command
find . -name "c*" -size +30 -exec ls -ls {} \;
I get a list of files, the first column is the block size, right?
... (1 Reply)
Discussion started by: gio001
1 Replies
9. Shell Programming and Scripting
Hi All...
is the below command be modified in sucha way that i can get the file size along with the name and path of the file
the below command only gives me the file location which are more than 100000k...but I want the exact size of the file also..
find / -name "*.*" -size +100000k
... (3 Replies)
Discussion started by: rpraharaj84
3 Replies
10. Shell Programming and Scripting
Hi,
how to know the size of the files in the directory, exclusing the subfolder. ?
i tried du -h
du -sk
du -k
but its not giving.. (2 Replies)
Discussion started by: mail2sant
2 Replies
LEARN ABOUT PHP
mongocollection.findone
MONGOCOLLECTION.FINDONE(3) 1 MONGOCOLLECTION.FINDONE(3)
MongoCollection::findOne - Queries this collection, returning a single element
SYNOPSIS
public array MongoCollection::findOne ([array $query = array()], [array $fields = array()], [array $options = array()])
DESCRIPTION
As opposed to MongoCollection.find(3), this method will return only the first result from the result set, and not a MongoCursor that can
be iterated over.
PARAMETERS
o $query
- The fields for which to search. MongoDB's query language is quite extensive. The PHP driver will in almost all cases pass the
query straight through to the server, so reading the MongoDB core docs on find is a good idea.
Warning
Please make sure that for all special query operaters (starting with $) you use single quotes so that PHP doesn't try to
replace "$exists" with the value of the variable $exists.
o $fields
- Fields of the results to return. The array is in the format array('fieldname' => true, 'fieldname2' => true). The _id field is
always returned.
o $options
- This parameter is an associative array of the form array("name" => <value>, ...). Currently supported options are:
o "maxTimeMS"Specifies a cumulative time limit in milliseconds for processing the operation (does not include idle time). If
the operation is not completed within the timeout period, a MongoExecutionTimeoutException will be thrown.
RETURN VALUES
Returns record matching the search or NULL.
ERRORS
/EXCEPTIONS
Throws MongoConnectionException if it cannot reach the database.
CHANGELOG
+--------+------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+------------------------------------+
| 1.5.0 | |
| | |
| | Added optional $options argument. |
| | |
+--------+------------------------------------+
EXAMPLES
Example #1
MongoCollection::findOne document by its id.
This example demonstrates how to find a single document in a collection by its id.
<?php
$articles = $mongo->my_db->articles;
$article = $articles->findOne(array('_id' => new MongoId('47cc67093475061e3d9536d2')));
?>
Example #2
MongoCollection::findOne document by some condition.
This example demonstrates how to find a single document in a collection by some condition and limiting the returned fields.
<?php
$users = $mongo->my_db->users;
$user = $users->findOne(array('username' => 'jwage'), array('password'));
print_r($user);
?>
The above example will output something similar to:
Array
(
[_id] => MongoId Object
(
)
[password] => test
)
Notice how even though the document does have a username field, we limited the results to only contain the password field.
SEE ALSO
MongoCollection.find(3), MongoCollection.insert(3), MongoDB core docs on find..
PHP Documentation Group MONGOCOLLECTION.FINDONE(3)