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
UDM_CAT_LIST(3) 1 UDM_CAT_LIST(3)udm_cat_list - Get all the categories on the same level with the current oneSYNOPSIS
array udm_cat_list (resource $agent, string $category)
DESCRIPTION
Gets all the categories on the same level with the current one.
The function can be useful for developing categories tree browser.
PARAMETERS
o $agent
- A link to Agent, received after call to udm_alloc_agent(3).
o $category
-
RETURN VALUES
Returns an array listing all categories of the same level as the current $category in the categories tree.
The returned array consists of pairs. Elements with even index numbers contain the category paths, odd elements contain the corresponding
category names.
$array[0] will contain '020300'
$array[1] will contain 'Audi'
$array[2] will contain '020301'
$array[3] will contain 'BMW'
$array[4] will contain '020302'
$array[5] will contain 'Opel'
...
etc.
EXAMPLES
Following is an example of displaying links of the current level in format:
Audi
BMW
Opel
...
Example #1
udm_cat_list(3)example
<?php
$cat_list_arr = udm_cat_list($udm_agent, $cat);
$cat_list = '';
for ($i=0; $i<count($cat_list_arr); $i+=2) {
$path = $cat_list_arr[$i];
$name = $cat_list_arr[$i+1];
$cat_list .= "<a href="$_SERVER[PHP_SELF]?cat=$path">$name</a><br />";
}
?>
SEE ALSO udm_cat_path(3).
PHP Documentation Group UDM_CAT_LIST(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)