User's Manual
Beta Draft Building Global Applications 8-1
8
Building Global Applications
This chapter discusses global application development in a PHP and Oracle Database
Express environment. It addresses the basic tasks associated with developing and
deploying global Internet applications, including developing locale awareness,
constructing HTML content in the user preferred language, and presenting data
following the cultural conventions of the user's locale.
Building a global Internet application that supports different locales requires good
development practices. A locale refers to a national language and the region in which
the language is spoken. The application itself must be aware of the user's locale
preference and be able to present content following the cultural convention expected
by the user. It is important to present data with appropriate locale characteristics, such
as using the correct date and number formats. Oracle Database Express is fully
internationalized to provide a global platform for developing and deploying global
applications.
This chapter has the following topics:
Q Establishing the Environment between Oracle and PHP
Q String Manipulation
Q Determining User's Locale
Q Developing Locale Awareness
Q Encoding HTML Pages
Q Organizing the Content of HTML Pages for Translation
Q Presenting Data following User's Locale Convention
Establishing the Environment between Oracle and PHP
Correctly setting up the connectivity between the PHP engine and the Oracle database
is first step in building a global application, it guarantees data integrity across all tiers.
Most internet based standards support Unicode as a character encoding, in this
chapter we will focus on using Unicode as the character set for data exchange.
PHP is an Oracle OCI application and rules that apply to OCI also apply to PHP.
Oracle locale behavior including the client character set used in OCI application are
defined by an environment variable NLS_LANG which has the form:
<language>_<territory>.<character set>
For example, for a German user in Germany running their application in Unicode,
NLS_LANG should be set to
GERMAN_GERMANY.AL32UTF8