UDM_CAT_PATH(3) 1 UDM_CAT_PATH(3)udm_cat_path - Get the path to the current categorySYNOPSIS
array udm_cat_path (resource $agent, string $category)
DESCRIPTION
Returns an array describing the path in the categories tree from the tree root to the current one, specified by $category.
PARAMETERS
o $agent
- A link to Agent, received after call to udm_alloc_agent(3).
o $category
-
RETURN VALUES
The returned array consists of pairs. Elements with even index numbers contain the category paths, odd elements contain the corresponding
category names.
For example, the call $array=udm_cat_path($agent, '02031D'); may return the following array:
$array[0] will contain ''
$array[1] will contain 'Root'
$array[2] will contain '02'
$array[3] will contain 'Sport'
$array[4] will contain '0203'
$array[5] will contain 'Auto'
$array[4] will contain '02031D'
$array[5] will contain 'Ferrari'
EXAMPLES
Example #1
Specifying path to the current category in the following format: '> Root > Sport > Auto > Ferrari'
<?php
$cat_path_arr = udm_cat_path($udm_agent, $cat);
$cat_path = '';
for ($i=0; $i<count($cat_path_arr); $i+=2) {
$path = $cat_path_arr[$i];
$name = $cat_path_arr[$i+1];
$cat_path .= " > <a href="$_SERVER[PHP_SELF]?cat=$path">$name</a> ";
}
?>
SEE ALSO udm_cat_list(3).
PHP Documentation Group UDM_CAT_PATH(3)
Check Out this Related Man Page
ARRAY_PRODUCT(3) 1 ARRAY_PRODUCT(3)array_product - Calculate the product of values in an arraySYNOPSIS
number array_product (array $array)
DESCRIPTION array_product(3) returns the product of values in an array.
PARAMETERS
o $array
- The array.
RETURN VALUES
Returns the product as an integer or float.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.6 | |
| | |
| | The product of an empty array is now 1, when |
| | before this function would return 0 for an empty |
| | array. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
array_product(3) examples
<?php
$a = array(2, 4, 6, 8);
echo "product(a) = " . array_product($a) . "
";
echo "product(array()) = " . array_product(array()) . "
";
?>
The above example will output:
product(a) = 384
product(array()) = 1
PHP Documentation Group ARRAY_PRODUCT(3)
hello again guys
do you know if it is possible to change IFS in a array?
i have a file like this:
name 1243 5454
name2 545 5455
i use a simple command like this to popolate the array:
data=`cat /usr1/air/tmp/data.txt`
arrei_data=($data)
the problem is that i want an array position for... (5 Replies)
Discussion started by: elionba82
5 Replies
2. Post Here to Contact Site Administrators and Moderators
Hi,
I submitted my blog on UNIX in the links section. On submitting, i chose the category as Unix/Linux standards, which i now feel is incorrect. I would like to change the category of my link, but i don't find any option to change the category.
Please help me in doing the needful.
Thanks... (7 Replies)
i'm trying to figure out how to store strings into an array, can someone help me figure it out?
i would like to store the following for example:
array = "dog"
array = "cat"
the inputs are coming from the command line.
Thanks, (6 Replies)
I am working to import a file and have almost all the information accounted for except this last item. First of all the file name is the category and this is what I need to append to the file.
The catch I believe is the fact the file name has spaces in it.
Filename CPU Products.csv
File... (3 Replies)
Hello experts,
I wish to print the contents of odd-even numbered indices of an array.
The problem statement is as follows :
1. The first line contains an integer, (the number of test cases).
2. Each line of the subsequent lines containing a string.
Example:
2
Haider
Bash
... (4 Replies)
I have a csv file that looks like this
Name,Food,Sport
James,Curry,Gym
Darren,Pizza,Football
Jim,Fish,Hockey
James,Sushi,Tennis
My code looks like this
IFS=","
sed 1d $file_name | while read Name Food Sport
do
mkdir -p $Name
#echo "=================="
#echo "Name: $Name" (3 Replies)