Sponsored Content
Full Discussion: Help with this exercise
Homework and Emergencies Homework & Coursework Questions Help with this exercise Post 302389278 by Scott on Saturday 23rd of January 2010 10:00:15 PM
Old 01-23-2010
Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

Thank You.
 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

[question] trouble with an 'exercise'

Hello guys.. well, im kinda newbie with unix because i started to learn it like 2 weeks ago. then i started to make some exercises, but i got stucked on this one : so, i need to know how many different 'names' has the 5th field and how many times each name appears. i was trying with a... (6 Replies)
Discussion started by: EnioMarques
6 Replies

2. UNIX for Dummies Questions & Answers

[question] hard exercise, help needed

Hello guys. Well, on this exercise i need the average "chargeAmount" per hour (for each hour). with this code : cat getusagesummarywrongmatch | grep -iv MOU2GRTObject | cut -d'|' -f4,14 | grep -i chargeamount | cut -d' ' -f2 http://img227.imageshack.us/img227/5889/65969235do0.jpg i got... (2 Replies)
Discussion started by: EnioMarques
2 Replies

3. Shell Programming and Scripting

Trouble with part of an exercise

Hi, 'm trying to do an exercicise, and one part is: ls -l $1 | awk ' BEGIN { max = $5; } { if ($5 > max){ max = $5; } } END { print "Tamanio mayor fichero = " max; }' # Imprimimos ahora el menor tamaņo de fichero ls -l $1 | awk '... (4 Replies)
Discussion started by: Phass
4 Replies

4. Shell Programming and Scripting

A very tough exercise

hello everyone!:) I have an exercise which I think is difficult for beginner like me. Here is the exercise Create a shell script, which takes a directory as command line argument. Script displays ten first lines from every text file in that directory. After displaying the lines from the... (1 Reply)
Discussion started by: googlevn
1 Replies

5. UNIX for Dummies Questions & Answers

UNIX Exercise

Hi, I am learning unix. I want to practice few small excercises. Please suggest me some goor URL to practice. Thanks in advance. (1 Reply)
Discussion started by: stew
1 Replies

6. Homework & Coursework Questions

Grades exercise

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a shell script program that will input a name and a mark between 0 and 100. The program then displays the... (9 Replies)
Discussion started by: UniverseCloud
9 Replies
YAML_PARSE(3)								 1							     YAML_PARSE(3)

yaml_parse - Parse a YAML stream

SYNOPSIS
mixed yaml_parse (string $input, [int $pos], [int &$ndocs], [array $callbacks]) DESCRIPTION
Convert all or part of a YAML document stream to a PHP variable. PARAMETERS
o $input - The string to parse as a YAML document stream. o $pos - Document to extract from stream ( -1 for all documents, 0 for first document, ...). o $ndocs - If $ndocs is provided, then it is filled with the number of documents found in stream. o $callbacks - Content handlers for YAML nodes. Associative array of YAML tag => callable mappings. See parse callbacks for more details. RETURN VALUES
Returns the value encoded in $input in appropriate PHP type or FALSE on failure. If $pos is -1 an array will be returned with one entry for each document found in the stream. EXAMPLES
Example #1 yaml_parse(3) example <?php $yaml = <<<EOD --- invoice: 34843 date: "2001-01-23" bill-to: &id001 given: Chris family: Dumars address: lines: |- 458 Walkman Dr. Suite #292 city: Royal Oak state: MI postal: 48046 ship-to: *id001 product: - sku: BL394D quantity: 4 description: Basketball price: 450 - sku: BL4438H quantity: 1 description: Super Hoop price: 2392 tax: 251.420000 total: 4443.520000 comments: Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338. EOD; $parsed = yaml_parse($yaml); var_dump($parsed); ?> The above example will output something similar to: array(8) { ["invoice"]=> int(34843) ["date"]=> string(10) "2001-01-23" ["bill-to"]=> &array(3) { ["given"]=> string(5) "Chris" ["family"]=> string(6) "Dumars" ["address"]=> array(4) { ["lines"]=> string(34) "458 Walkman Dr. Suite #292" ["city"]=> string(9) "Royal Oak" ["state"]=> string(2) "MI" ["postal"]=> int(48046) } } ["ship-to"]=> &array(3) { ["given"]=> string(5) "Chris" ["family"]=> string(6) "Dumars" ["address"]=> array(4) { ["lines"]=> string(34) "458 Walkman Dr. Suite #292" ["city"]=> string(9) "Royal Oak" ["state"]=> string(2) "MI" ["postal"]=> int(48046) } } ["product"]=> array(2) { [0]=> array(4) { ["sku"]=> string(6) "BL394D" ["quantity"]=> int(4) ["description"]=> string(10) "Basketball" ["price"]=> int(450) } [1]=> array(4) { ["sku"]=> string(7) "BL4438H" ["quantity"]=> int(1) ["description"]=> string(10) "Super Hoop" ["price"]=> int(2392) } } ["tax"]=> float(251.42) ["total"]=> float(4443.52) ["comments"]=> string(68) "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338." } NOTES
Warning Processing untrusted user input with yaml_parse(3) is dangerous if the use of unserialize(3) is enabled for nodes using the !php/object tag. This behavior can be disabled by using the yaml.decode_php ini setting. SEE ALSO
yaml_parse_file(3), yaml_parse_url(3), yaml_emit(3). PHP Documentation Group YAML_PARSE(3)
All times are GMT -4. The time now is 05:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy