PHP: gettext - Manual in Deutsh
PHP: gettext - Manual in French
PHP: gettext - Manual in Polish

You Are At PHP: gettext - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevNext

gettext

(PHP 3 >= 3.0.7, PHP 4, PHP 5)

gettext -- Lookup a message in the current domain

Description

string gettext ( string message )

Looks up a message in the current domain.

Parameters

message

Return Values

Returns a translated string if one is found in the translation table, or the submitted message if not found.

Examples

Example 1. gettext()-check

<?php
// Set language to German
setlocale(LC_ALL, 'de_DE');

// Specify location of translation tables
bindtextdomain("myPHPApp", "./locale");

// Choose domain
textdomain("myPHPApp");

// Translation is looking for in ./locale/de_DE/LC_MESSAGES/myPHPApp.mo now

// Print a test message
echo gettext("Welcome to My PHP Application");

// Or use the alias _() for gettext()
echo _("Have a nice day");
?>

Notes

Note: You may use the underscore character '_' as an alias to this function.

See Also

setlocale()

Najlepsza ochrona mienia na rynku
tłumaczenia
opakowania z nadrukiem
Najlepsza organizacja eventów Gorąco Polecamy!
Strony internetowe

Another Useful functions:


ref.gettext | function.ngettext | function.hw-gettext | function.harupage-gettextwidth | function.harupage-gettextrise | function.harupage-gettextrenderingmode | function.harupage-gettextmatrix | function.harupage-gettextleading | function.harufont-gettextwidth | function.gettext | function.dngettext | function.dgettext | function.dcngettext | function.dcgettext |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.