php man page for msgfmt_set_pattern

Query: msgfmt_set_pattern

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

MSGFMT_SET_PATTERN(3)							 1						     MSGFMT_SET_PATTERN(3)

MessageFormatter::setPattern - Set the pattern used by the formatter

	Object oriented style

SYNOPSIS
public bool MessageFormatter::setPattern (string $pattern)
DESCRIPTION
Procedural style bool msgfmt_set_pattern (MessageFormatter $fmt, string $pattern) Set the pattern used by the formatter
PARAMETERS
o $fmt - The message formatter o $pattern - The pattern string to use in this message formatter. The pattern uses an 'apostrophe-friendly' syntax; it is run through umsg_autoQuoteApostrophe before being interpreted.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1 msgfmt_set_pattern(3) example <?php $fmt = msgfmt_create( "en_US", "{0, number} monkeys on {1, number} trees" ); echo "Default pattern: '" . msgfmt_get_pattern( $fmt ) . "' "; echo "Formatting result: " . msgfmt_format( $fmt, array(123, 456) ) . " "; msgfmt_set_pattern( $fmt, "{0, number} trees hosting {1, number} monkeys" ); echo "New pattern: '" . msgfmt_get_pattern( $fmt ) . "' "; echo "Formatted number: " . msgfmt_format( $fmt, array(123, 456) ) . " "; ?> Example #2 OO example <?php $fmt = new MessageFormatter( "en_US", "{0, number} monkeys on {1, number} trees" ); echo "Default pattern: '" . $fmt->getPattern() . "' "; echo "Formatting result: " . $fmt->format(array(123, 456)) . " "; $fmt->setPattern("{0, number} trees hosting {1, number} monkeys" ); echo "New pattern: '" . $fmt->getPattern() . "' "; echo "Formatted number: " . $fmt->format(array(123, 456)) . " "; ?> The above example will output: Default pattern: '{0,number} monkeys on {1,number} trees' Formatting result: 123 monkeys on 456 trees New pattern: '{0,number} trees hosting {1,number} monkeys' Formatted number: 123 trees hosting 456 monkeys
SEE ALSO
msgfmt_create(3), msgfmt_get_pattern(3). PHP Documentation Group MSGFMT_SET_PATTERN(3)
Related Man Pages
datefmt_get_locale(3) - php
datefmt_get_pattern(3) - php
datefmt_set_pattern(3) - php
msgfmt_get_pattern(3) - php
msgfmt_parse(3) - php
Similar Topics in the Unix Linux Community
change a field in a file
What's the difference between \d , [:digit:], and [0-9] in regular expression ?
Merge two columns from two files into one if another column matches
File comparisons
Trouble reading from a tab delimited excel file