print - 文字列を出力する
printは、文字列を出力する関数です。echoと似ていますが、こちらは引数を1つしか受け付けません。言語構造なので、他の関数のように引数を括弧でくくる必要はありません。
構文
パラメータ
$arg
出力する文字列。
返り値
int
常に1
を返す。
サンプルコード
<?php
print "SYNCER" ;
デモ
文字列を出力します。
<?php
/*** このコードは編集できます。 ***/
print "SYNCER" ;
変数の中身を出力します。
<?php
/*** このコードは編集できます。 ***/
$a = "SYNCER" ;
print $a ;
参考
- PHP: print
- PHPの公式リファレンス。
関連記事
- quoted_printable_decode
- quoted-printable文字列を8ビット文字列に変換する。
- quoted_printable_encode
- 8ビット文字列をquoted-printable文字列に変換する。
- convert_uuencode
- 文字列をuuencodeアルゴリズムでエンコードする。
- convert_cyr_string
- キリル文字セットを別に変換する。
- convert_uudecode
- 文字列をuuencodeアルゴリズムでデコードする。
- var_export
- 変数の文字列表現を取得する。