« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 24 for href (0.004 sec.)
output_reset_rewrite_vars — URL リライタの値をリセットする | PHP 8.3 12476
output_reset_rewrite_vars (PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8) output_reset_rewrite_vars — URL リライタの値をリセットする 説明 function output_reset_rewrite_vars (): bool この関数は、 output_add_rewrite_var() 関数によって事前に設定されたリ ... リライト変数だけを削除するようになります。 例 例1 output_reset_rewrite_vars() の例 <?php ini_set ( 'url_rewriter.tags' , 'a=href' ); output_add_rewrite_var ( 'var' , 'value' ); echo '<a href="file.php">link</a>' ; ob_flush (); output_reset_rewrite_var ... s (); echo '<a href="file.php">link</a>' ; ?> 上の例の出力は以下となります。 <a href="file.php?var=value">link</a> <a href="file.php">link</a> ...
https://man.mtool.work/php/8.3/function.output-reset-rewrite-vars.html
rawurlencode — RFC 3986 に基づき URL エンコードを行う | PHP 8.3 11392
rawurlencode (PHP 4, PHP 5, PHP 7, PHP 8) rawurlencode — RFC 3986 に基づき URL エンコードを行う 説明 function rawurlencode ( string $string ): string 指定した文字列を » RFC 3986 にもとづいてエンコードします。 パラメータ string エンコードする ... ことが ないように、 » RFC 3986 で定められたエンコーディング方法です。 例 例1 FTP URL へのパスワードの埋め込み <?php echo '<a href="ftp://user:' , rawurlencode ( 'foo @+%/' ), '@ftp.example.com/x.txt">' ; ?> 上の例の出力は以下となります。 <a href="ftp:/ ... 25%2F@ftp.example.com/x.txt"> あるいは、URL の PATH_INFO 中の情報を渡した場合は、 例2 rawurlencode() の例 2 <?php echo '<a href="http://example.com/department_list_script/' , rawurlencode ( 'sales and marketing/Miami' ), '">' ; ?> 上の例の出力は以下と ... なります。 <a href="http://example.com/department_list_script/sales%20and%20marketing%2FMiami"> 参考 rawurldecode() - URL エンコードされた文字 ...
https://man.mtool.work/php/8.3/function.rawurlencode.html
出力リライトの使用法 | PHP 8.3 11259
出力リライトの使用法 PHP 7.1.0 以降は、 output_add_rewrite_var() と output_reset_rewrite_vars() は専用の出力バッファを用いるようになります。 透過的セッションID の出力バッファは用いません。 例1 出力リライトの例 <?php // このコードは PHP 7.1. ... トホストです。適切に書き換えてください $_SERVER [ 'HTTP_HOST' ] = 'php.net' ; // 出力リライトはフォームだけを書き換えます。a=href を追加します。 // タグは tag_name=url_attr 形式で指定します。たとえば img=src,iframe=src のようになります。 // 各設定の間に ... スペースを含めることはできません。 // form タグは特別なタグで、hidden を追加します。 ini_set ( 'url_rewriter.tags' , 'a=href,form=' ); var_dump ( ini_get ( 'url_rewriter.tags' )); // これが URL と form に追加されます output_add_rewrite_var ( 'test ... ' , 'value' ); ?> <a href="//php.net/index.php?bug=1234">bug1234</a> <form action="https://php.net/?bug=1234&edit=1" method="post"> <input type="tex ...
https://man.mtool.work/php/8.3/outcontrol.examples.rewrite.html
output_add_rewrite_var — URL リライタの値を追加する | PHP 8.3 10992
output_add_rewrite_var (PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8) output_add_rewrite_var — URL リライタの値を追加する 説明 function output_add_rewrite_var ( string $name , string $value ): bool この関数は、 'URL-Rewriter' 出力バッファハンドラをア ... た。 ( session.trans_sid_tags を参照ください) 例 例1 output_add_rewrite_var() の例 <?php ini_set ( 'url_rewriter.tags' , 'a=href,form=' ); output_add_rewrite_var ( 'var' , 'value' ); // リンク echo '<a href="file.php">link</a> <a href="http://example. ... ="post"> <input type="text" name="var2" /> </form>' ; print_r ( ob_list_handlers ()); ?> 上の例の出力は以下となります。 <a href="file.php?var=value">link</a> <a href="http://example.com">link2</a> <form action="script.php" method="post"> <input type= ...
https://man.mtool.work/php/8.3/function.output-add-rewrite-var.html
urlencode — 文字列を URL エンコードする | PHP 8.3 10175
urlencode (PHP 4, PHP 5, PHP 7, PHP 8) urlencode — 文字列を URL エンコードする 説明 function urlencode ( string $string ): string この関数は、URL の問い合わせ部分に使用する文字列のエンコードや 次のページへ変数を渡す際に便利です。 パラメータ ... にエンコードします。 例 例1 urlencode() の例 <?php $userinput = 'Data123!@-_ +' ; echo "UserInput: $userinput \n" ; echo '<a href="mycgi?foo=' , urlencode ( $userinput ), '">' ; ?> 上の例の出力は以下となります。 UserInput: Data123!@-_ + <a href="mycgi? ... foo: $foo \n" ; echo "bar: $bar \n" ; $query_string = 'foo=' . urlencode ( $foo ) . '&bar=' . urlencode ( $bar ); echo '<a href="mycgi?' . htmlentities ( $query_string ) . '">' ; ?> 上の例の出力は以下となります。 foo: Data123!@-_ + bar: Not the same ... content as Data123!@-_ + <a href="mycgi?foo=Data123%21%40-_+%2B&amp;bar=Not+the+same+content+as+Data123%21%40-_+%2B"> 注意 注意 : HTML エンティティにマッチ ...
https://man.mtool.work/php/8.3/function.urlencode.html
DOMDocument::xinclude — DOMDocument オブジェクト内の XIncludes を置換する | PHP... 9507
DOMDocument::xinclude (PHP 5, PHP 7, PHP 8) DOMDocument::xinclude — DOMDocument オブジェクト内の XIncludes を置換する 説明 public function DOMDocument::xinclude ( int $options = 0 ): int | false このメソッドは、DOMDocument オブジェクト内の ... 告 信頼できない XML に対してこのメソッドをコールすることは避けてください。 XIncludes は、外部のウェブサイトにあるファイル ( href 属性が URL の場合) や、任意のローカルファイル ( href 属性で file:// を使っている場合) を include できるからです。 パラメー ... n="1.0" ?> <chapter xmlns:xi="http://www.w3.org/2001/XInclude"> <title>Books of the other guy..</title> <para> <xi:include href="examples/book.xml"> <xi:fallback> <error>xinclude: book.xml not found</error> </xi:fallback> </xi:include> </para> </chap ...
https://man.mtool.work/php/8.3/domdocument.xinclude.html
session_start — 新しいセッションを開始、あるいは既存のセッションを再開する | PH... 8423
session_start (PHP 4, PHP 5, PHP 7, PHP 8) session_start — 新しいセッションを開始、あるいは既存のセッションを再開する 説明 function session_start ( array $options = [] ): bool session_start() は、セッションを作成します。 もしくは、リクエスト ... $_SESSION [ 'animal' ] = 'cat' ; $_SESSION [ 'time' ] = time (); // セッションクッキーが有効なら動作します echo '<br /><a href="page2.php">page 2</a>' ; // あるいは必要に応じてセッション ID を渡します echo '<br /><a href="page2.php?' . SID . '">page ... t echo date ( 'Y m d H:i:s' , $_SESSION [ 'time' ]); // page1.php と同様に、ここで SID を使うこともできます echo '<br /><a href="page1.php">page 1</a>' ; ?> session_start() のオプションの指定 例3 クッキーの有効期限の上書き <?php // これは、有効期限が ...
https://man.mtool.work/php/8.3/function.session-start.html
filter_input — 指定した名前の変数を外部から受け取り、オプションでそれをフィルタ... 8273
filter_input (PHP 5 >= 5.2.0, PHP 7, PHP 8) filter_input — 指定した名前の変数を外部から受け取り、オプションでそれをフィルタリングする 説明 function filter_input ( int $type , string $var_name , int $filter = FILTER_DEFAULT , array | int $op ... filter_input ( INPUT_GET , 'search' , FILTER_SANITIZE_ENCODED ); echo "You have searched for $search_html .\n" ; echo "<a href='?search= $search_url '>Search again.</a>" ; ?> 上の例の出力は、 たとえば以下のようになります。 You have searched for Me & ... #38; son. <a href='?search=Me%20%26%20son'>Search again.</a> 参考 filter_input_array() - 外部から変数を受け取り、オプションでそれらをフィルタ ...
https://man.mtool.work/php/8.3/function.filter-input.html
preg_match_all — 繰り返し正規表現検索を行う | PHP 8.3 8140
preg_match_all (PHP 4, PHP 5, PHP 7, PHP 8) preg_match_all — 繰り返し正規表現検索を行う 説明 function preg_match_all ( string $pattern , string $subject , array &$matches = null , int $flags = 0 , int $offset = 0 ): int | false subject を検 ... いことを pcre に伝える。 // 文字列が二重引用符で括られているため、バックスラッシュの追加が必要。 $html = "<b>bold text</b><a href=howdy.html>click me</a>" ; preg_match_all ( "/(<([\w]+)[^>]*>)(.*?)(<\/\\2>)/" , $html , $matches , PREG_SET_ORDER ); fore ... 上の例の出力は以下となります。 matched: <b>bold text</b> part 1: <b> part 2: b part 3: bold text part 4: </b> matched: <a href=howdy.html>click me</a> part 1: <a href=howdy.html> part 2: a part 3: click me part 4: </a> 例3 名前つきサブパターンの使用 ...
https://man.mtool.work/php/8.3/function.preg-match-all.html
strip_tags — 文字列から HTML および PHP タグを取り除く | PHP 8.3 8140
strip_tags (PHP 4, PHP 5, PHP 7, PHP 8) strip_tags — 文字列から HTML および PHP タグを取り除く 説明 function strip_tags ( string $string , array | string | null $allowed_tags = null ): string この関数は、指定した文字列 ( string ) から全ての ... は、 array も受け入れるようになりました。 例 例1 strip_tags() の例 <?php $text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>' ; echo strip_tags ( $text ); echo "\n" ; // <p> と <a> は許可します echo strip_tags ( $text , ... echo strip_tags($text, ['p', 'a']); ?> 上の例の出力は以下となります。 Test paragraph. Other text <p>Test paragraph.</p> <a href="#fragment">Other text</a> 注意 警告 XSS攻撃を防ぐ目的で、この関数を使うべきではありません。 htmlspecialchars() のような、 ...
https://man.mtool.work/php/8.3/function.strip-tags.html
PREV 1 2 3 NEXT