« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 108 for sprintf (0.005 sec.)
フォーマットされた文字列を返す 12235
« soundex sscanf » PHP Manual String 関数 フォーマットされた文字列を返す 検索 sprintf (PHP 4, PHP 5, PHP 7, PHP 8) sprintf — フォーマットされた文字列を返す 説明 function sprintf ( string $format , mixed ...$values ): string フォーマット文字 ... 番号付け/交換 をサポートしています。 <?php $num = 5 ; $location = 'tree' ; $format = 'There are %d monkeys in the %s' ; echo sprintf ( $format , $num , $location ); ?> 上の例の出力は以下となります。 There are 5 monkeys in the tree ここで、フォーマット文字 ... の 番号付け/交換 をサポートしています。 <?php $num = 5 ; $location = 'tree' ; $format = 'The %s contains %d monkeys' ; echo sprintf ( $format , $num , $location ); ?> ここで、問題が発生します。フォーマット文字列における置換指示子の順番は、 コードにおける ... ましょう。 例3 順序付きの置換指示子 <?php $num = 5 ; $location = 'tree' ; $format = 'The %2$s contains %1$d monkeys' ; echo sprintf ( $format , $num , $location ); ?> こうすることによるもうひとつの利点は、 同じ置換指示子を複数回使用する際にコードに引数を ...
https://man.mtool.work/php/8.3/function.sprintf.html
フォーマットされた文字列を返す 12133
« soundex sscanf » PHP Manual String 関数 フォーマットされた文字列を返す 検索 sprintf (PHP 4, PHP 5, PHP 7, PHP 8) sprintf — フォーマットされた文字列を返す 説明 function sprintf ( string $format , mixed ...$values ): string フォーマット文字 ... 番号付け/交換 をサポートしています。 <?php $num = 5 ; $location = 'tree' ; $format = 'There are %d monkeys in the %s' ; echo sprintf ( $format , $num , $location ); ?> 上の例の出力は以下となります。 There are 5 monkeys in the tree ここで、フォーマット文字 ... の 番号付け/交換 をサポートしています。 <?php $num = 5 ; $location = 'tree' ; $format = 'The %s contains %d monkeys' ; echo sprintf ( $format , $num , $location ); ?> ここで、問題が発生します。フォーマット文字列における置換指示子の順番は、 コードにおける ... ましょう。 例3 順序付きの置換指示子 <?php $num = 5 ; $location = 'tree' ; $format = 'The %2$s contains %1$d monkeys' ; echo sprintf ( $format , $num , $location ); ?> こうすることによるもうひとつの利点は、 同じ置換指示子を複数回使用する際にコードに引数を ...
https://man.mtool.work/php/8.3/function.sprintf.html
Quotes and escapes a string for use in an SQL statement 8828
« mysqli::query mysqli::real_connect » PHP Manual mysqli Quotes and escapes a string for use in an SQL statement 検索 mysqli::quote_string mysqli_quote_string (PHP 8 >= 8.6.0) mysqli::quote_string -- mysqli_quote_string — Quotes and escapes ... "my_user" , "my_password" , "world" ); $city = "'s-Hertogenbosch" ; /* this query with quoted $city will work */ $query = sprintf ( "SELECT CountryCode FROM City WHERE name=%s" , $mysqli -> quote_string ( $city )); $result = $mysqli -> query ( $query ) ... eturned %d rows.\n" , $result -> num_rows ); /* this query will fail, because we didn't quote and escape $city */ $query = sprintf ( "SELECT CountryCode FROM City WHERE name='%s'" , $city ); $result = $mysqli -> query ( $query ); 手続き型 <?php mysqli_r ... "my_user" , "my_password" , "world" ); $city = "'s-Hertogenbosch" ; /* this query with quoted $city will work */ $query = sprintf ( "SELECT CountryCode FROM City WHERE name=%s" , mysqli_quote_string ( $mysqli , $city )); $result = mysqli_query ( $mysql ...
https://man.mtool.work/php/8.3/mysqli.quote-string.html
Quotes and escapes a string for use in an SQL statement 8828
« mysqli::query mysqli::real_connect » PHP Manual mysqli Quotes and escapes a string for use in an SQL statement 検索 mysqli::quote_string mysqli_quote_string (PHP 8 >= 8.6.0) mysqli::quote_string -- mysqli_quote_string — Quotes and escapes ... "my_user" , "my_password" , "world" ); $city = "'s-Hertogenbosch" ; /* this query with quoted $city will work */ $query = sprintf ( "SELECT CountryCode FROM City WHERE name=%s" , $mysqli -> quote_string ( $city )); $result = $mysqli -> query ( $query ) ... eturned %d rows.\n" , $result -> num_rows ); /* this query will fail, because we didn't quote and escape $city */ $query = sprintf ( "SELECT CountryCode FROM City WHERE name='%s'" , $city ); $result = $mysqli -> query ( $query ); 手続き型 <?php mysqli_r ... "my_user" , "my_password" , "world" ); $city = "'s-Hertogenbosch" ; /* this query with quoted $city will work */ $query = sprintf ( "SELECT CountryCode FROM City WHERE name=%s" , mysqli_quote_string ( $mysqli , $city )); $result = mysqli_query ( $mysql ...
https://man.mtool.work/php/8.3/mysqli.quote-string.html
ファイルのパーミッションを取得する 8828
« SplFileInfo::getPathname SplFileInfo::getRealPath » PHP Manual SplFileInfo ファイルのパーミッションを取得する 検索 SplFileInfo::getPerms (PHP 5 >= 5.1.2, PHP 7, PHP 8) SplFileInfo::getPerms — ファイルのパーミッションを取得する 説明 public ... す。 失敗時に false を返します。 例 例1 SplFileInfo::getPerms() の例 <?php $info = new SplFileInfo ( '/tmp' ); echo substr ( sprintf ( '%o' , $info -> getPerms ()), - 4 ); $info = new SplFileInfo ( __FILE__ ); echo substr ( sprintf ( '%o' , $info -> getPe ... 上の例の出力は、 たとえば以下のようになります。 1777 0644 関連キーワード: SplFileInfo getPerms パーミッション info substr sprintf getPathname getRealPath ...
https://man.mtool.work/php/8.3/splfileinfo.getperms.html
ファイルのパーミッションを取得する 8726
« SplFileInfo::getPathname SplFileInfo::getRealPath » PHP Manual SplFileInfo ファイルのパーミッションを取得する 検索 SplFileInfo::getPerms (PHP 5 >= 5.1.2, PHP 7, PHP 8) SplFileInfo::getPerms — ファイルのパーミッションを取得する 説明 public ... す。 失敗時に false を返します。 例 例1 SplFileInfo::getPerms() の例 <?php $info = new SplFileInfo ( '/tmp' ); echo substr ( sprintf ( '%o' , $info -> getPerms ()), - 4 ); $info = new SplFileInfo ( __FILE__ ); echo substr ( sprintf ( '%o' , $info -> getPe ... ば以下のようになります。 1777 0644 関連キーワード: SplFileInfo getPerms パーミッション info false パラメータ new echo substr sprintf getPathname Search getRealPath function int 戻り値 失敗 php tmp navigate ...
https://man.mtool.work/php/8.3/splfileinfo.getperms.html
接続の現在の文字セットを考慮して、SQL 文で使用する文字列の特殊文字をエスケープす... 8624
« mysqli::real_connect mysqli::real_query » PHP Manual mysqli 接続の現在の文字セットを考慮して、SQL 文で使用する文字列の特殊文字をエスケープする 検索 mysqli::real_escape_string mysqli_real_escape_string (PHP 5, PHP 7, PHP 8) mysqli::real_es ... user" , "my_password" , "world" ); $city = "'s-Hertogenbosch" ; /* $city はエスケープされ、クエリは動作します。*/ $query = sprintf ( "SELECT CountryCode FROM City WHERE name='%s'" , $mysqli -> real_escape_string ( $city )); $result = $mysqli -> query ( ... %d rows.\n" , $result -> num_rows ); /* このクエリは失敗します。なぜなら、$city をエスケープしていないからです */ $query = sprintf ( "SELECT CountryCode FROM City WHERE name='%s'" , $city ); $result = $mysqli -> query ( $query ); 手続き型 <?php mysqli_r ... user" , "my_password" , "world" ); $city = "'s-Hertogenbosch" ; /* $city はエスケープされ、クエリは動作します。*/ $query = sprintf ( "SELECT CountryCode FROM City WHERE name='%s'" , mysqli_real_escape_string ( $mysqli , $city )); $result = mysqli_query ...
https://man.mtool.work/php/8.3/mysqli.real-escape-string.html
接続の現在の文字セットを考慮して、SQL 文で使用する文字列の特殊文字をエスケープす... 8624
« mysqli::real_connect mysqli::real_query » PHP Manual mysqli 接続の現在の文字セットを考慮して、SQL 文で使用する文字列の特殊文字をエスケープする 検索 mysqli::real_escape_string mysqli_real_escape_string (PHP 5, PHP 7, PHP 8) mysqli::real_es ... user" , "my_password" , "world" ); $city = "'s-Hertogenbosch" ; /* $city はエスケープされ、クエリは動作します。*/ $query = sprintf ( "SELECT CountryCode FROM City WHERE name='%s'" , $mysqli -> real_escape_string ( $city )); $result = $mysqli -> query ( ... %d rows.\n" , $result -> num_rows ); /* このクエリは失敗します。なぜなら、$city をエスケープしていないからです */ $query = sprintf ( "SELECT CountryCode FROM City WHERE name='%s'" , $city ); $result = $mysqli -> query ( $query ); 手続き型 <?php mysqli_r ... user" , "my_password" , "world" ); $city = "'s-Hertogenbosch" ; /* $city はエスケープされ、クエリは動作します。*/ $query = sprintf ( "SELECT CountryCode FROM City WHERE name='%s'" , mysqli_real_escape_string ( $mysqli , $city )); $result = mysqli_query ...
https://man.mtool.work/php/8.3/mysqli.real-escape-string.html
ドット表記の (IPv4) IP アドレスを、長整数表現に変換する 8318
« inet_pton long2ip » PHP Manual ネットワーク 関数 ドット表記の (IPv4) IP アドレスを、長整数表現に変換する 検索 ip2long (PHP 4, PHP 5, PHP 7, PHP 8) ip2long — ドット表記の (IPv4) IP アドレスを、長整数表現に変換する 説明 function ip2long ( s ... ); $out = "以下の URL は同じ意味です:<br />\n" ; $out .= 'http://www.example.com/, http://' . $ip . '/, そして http://' . sprintf ( "%u" , ip2long ( $ip )) . "/<br />\n" ; echo $out ; ?> 例2 IP アドレスの表示 2 番目の例は、変換されたアドレスを printf() ... ットアーキテクチャ上では 多くの IP アドレスが負の整数値になります。 そのため、符号なし IP アドレスを文字列形式で取得するには sprintf() や printf() で "%u" を使用する必要があります。 注意 : 32 ビット・システムでは、整数オーバーフローにより、 ip2long() は - ... 1 を返します。 参考 long2ip() - 長整数表現のインターネットアドレスを (IPv4) インターネット標準ドット表記に変換する sprintf() - フォーマットされた文字列を返す 関連キーワード: ip long アドレス 整数 表現 ドット 表記 IPv 変換 インターネット com echo ...
https://man.mtool.work/php/8.3/function.ip2long.html
ドット表記の (IPv4) IP アドレスを、長整数表現に変換する 8203
« inet_pton long2ip » PHP Manual ネットワーク 関数 ドット表記の (IPv4) IP アドレスを、長整数表現に変換する 検索 ip2long (PHP 4, PHP 5, PHP 7, PHP 8) ip2long — ドット表記の (IPv4) IP アドレスを、長整数表現に変換する 説明 function ip2long ( s ... ); $out = "以下の URL は同じ意味です:<br />\n" ; $out .= 'http://www.example.com/, http://' . $ip . '/, そして http://' . sprintf ( "%u" , ip2long ( $ip )) . "/<br />\n" ; echo $out ; ?> 例2 IP アドレスの表示 2 番目の例は、変換されたアドレスを printf() ... ットアーキテクチャ上では 多くの IP アドレスが負の整数値になります。 そのため、符号なし IP アドレスを文字列形式で取得するには sprintf() や printf() で "%u" を使用する必要があります。 注意 : 32 ビット・システムでは、整数オーバーフローにより、 ip2long() は - ... 1 を返します。 参考 long2ip() - 長整数表現のインターネットアドレスを (IPv4) インターネット標準ドット表記に変換する sprintf() - フォーマットされた文字列を返す 関連キーワード: long アドレス 整数 表現 ドット 表記 インターネット example sprintf prin ...
https://man.mtool.work/php/8.3/function.ip2long.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT