Output ASCII Character Strings from PHP Scripts

This section provides tutorial example on how to include output ASCII character strings in a PHP script file. ASCII characters can be entered directly as string literals in PHP code segments or as text in non-PHP code segments. No special techniques are needed.

As I mentioned earlier, ASCII characters can travel from PHP files to browsers easily without any trouble. Here is a simple PHP file with ASCII characters only:

<?php #HelpASCII.php
#- Copyright (c) 2015, HerongYang.com, All Rights Reserved.
#
   print("<html><body>\n");
   print("<b>Help</b><br/>\n");
   print("This is a very simple help page...<br/>\n");
?>
This is a very simple help page...<br/>
</body></html>

If you view this page with a browser, you will get the following output:

Help
This is a very simple help page...
This is a very simple help page...

Perfect, right? ASCII text entered as a PHP string literal travels through correctly. Text entered as HTML static text outside the PHP block travels through also correctly.

Last update: 2015.

Table of Contents

 About This Book

 Introduction and Installation of PHP 7.0

 PHP Script File Syntax

 PHP Data Types and Data Literals

 Variables, References, and Constants

 Expressions, Operations and Type Conversions

 Conditional Statements - "if" and "switch"

 Loop Statements - "while", "for", and "do ... while"

 Function Declaration, Arguments, and Return Values

 Arrays - Ordered Maps

 Configuring and Sending out Emails

 Retrieving Information from HTTP Requests

 Creating and Managing Sessions in PHP Scripts

 Sending and Receiving Cookies in PHP Scripts

 Controlling HTTP Response Header Lines in PHP Scripts

 MySQL Server Connection and Access Functions

 Functions to Manage Directories, Files and Images

 SOAP Extension Function and Calling Web Services

 SOAP Server Functions and Examples

Localization Overview of Web Applications

 What Is Localization / Internationalization?

 Localization of Web Based Applications

 Character String Traveling Paths

Output ASCII Character Strings from PHP Scripts

 Using Non-ASCII Characters in HTML Documents

 Using Non-ASCII Characters as PHP Script String Literals

 Receiving Non-ASCII Characters from Input Forms

 "mbstring" Extension and Non-ASCII Encoding Management

 Managing Non-ASCII Character Strings with MySQL Servers

 Introduction of Class and Object

 Integrating PHP with Apache Web Server

 Outdated Tutorials

 References

 PDF Printing Version