タグ

ブックマーク / www.php.net (12)

  • PHP: PHP の使いかた - Manual

    PHP の関数のパラメータの順番を覚えられません。だって関数によってばらばらなんだもん。 PHP は、さまざまな外部ライブラリの間を取り持つ糊のような存在です。 そのため、時にはちょっとごちゃごちゃすることもあります。 しかし、経験上、以下のような規則があるようです。 配列関数 のパラメータは "needle, haystack" の順だけれども、 文字列関数 はその逆で "haystack, needle" の順となります。 あらゆるフォームから送信されたデータを扱うことができる汎用的な PHPスクリプトを書きたいのですが、POSTメソッドでどのようなデータ が送信されたかを知るにはどうするのですか? PHPは$_POSTのような 定義済みの変数 を沢山提供しています。$_POSTを連想配列として ループすることでPOSTされた全ての値にアクセスできます。例えば、 foreach で単純

    yuiseki
    yuiseki 2012/01/29
    ヒー
  • PHP: 自動的に定義される定数 - Manual

    The __CLASS__ magic constant nicely complements the get_class() function. Sometimes you need to know both: - name of the inherited class - name of the class actually executed Here's an example that shows the possible solution: <?php class base_class { function say_a() { echo "'a' - said the " . __CLASS__ . "<br/>"; } function say_b() { echo "'b' - said the " . get_class($this) . "<br/>"; } } class

    yuiseki
    yuiseki 2011/08/09
  • PHP: 可変関数 - Manual

    可変関数 PHP は可変関数(variable functions)の概念をサポートします。 これにより、変数名の後に括弧が付いている場合、その値が何であろうと PHPは、同名の関数を探し実行を試みます。 この機能は、コールバック、関数テーブル等を実装するために使用可能です。 可変関数は、echo, print, isset(), empty(), include, require のような言語構造と組み合わせて使用する ことはできません。これらの言語構造を可変変数として使うには 独自のラッパー関数を使う必要があります。 <?php function foo() { echo "In foo()<br />\n"; } function bar($arg = '') { echo "In bar(); argument was '$arg'.<br />\n"; } // これは、echo

    yuiseki
    yuiseki 2010/09/21
  • PHP: unset - Manual

    Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Su

    yuiseki
    yuiseki 2010/09/21
  • PHP: Manual Quick Reference

    yuiseki
    yuiseki 2009/03/10
  • PHP: is_writeable - Manual

    yuiseki
    yuiseki 2007/12/18
  • PHP: 実行時設定 - Manual

    To run separate apache and php processes on centos (at least) without having to compile and install separate versions for every instance this should work: Install apache and php with yum. This will give you (for the first instance): /etc/httpd/*, /etc/sysconfig/httpd, /etc/init.d/httpd, /etc/php.ini and /etc/php.d/*. Copy all this stuff to: /etc/httpd2/*, /etc/sysconfig/httpd2, /etc/init.d/httpd2,

    yuiseki
    yuiseki 2006/06/29
  • PHP: 配列 関数 - Manual

    Be careful with type hints in callbacks when using array-traverse functions. In some cases, this may silently cause the data type of elements to change. <?php declare(strict_types=1); // Missing fatal TypeError, No side effects $unexpected = array_filter(['123', (string) PHP_INT_MAX], fn (int $item) => true); var_dump($unexpected); // Missing fatal TypeError, Typecasting side effect $unexpectedTyp

    yuiseki
    yuiseki 2006/05/08
  • PHP: PHP と HTML - Manual

    PHPHTML PHPHTML は深く関係しています。PHPHTML を生成し、HTML には PHP に 送信される情報が記述されています。 以下の FAQ を読む前に、どうやって 外部から来る変数を取得するかを読んでおくことは重要です。 このマニュアルにはこのトピックに関するよい例があります。 フォームから、もしくは URL から値を渡す場合にはどういった エンコード/デコードが必要なのですか? エンコードが重要になる場面はいくつかあります。 string $data という エンコードされていない文字列データを渡す場合について考えてみると、 HTML を通じて渡す場合: 文字列にはどのような値が含まれるか分からないので、 データは必ず htmlspecialchars を行い、 ダブルクオートで囲まなければなりません。 URL を通じて渡す場合: URL はいくつか

    yuiseki
    yuiseki 2006/05/04
  • PHP: SimpleXML 関数 - Manual

    Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Su

    yuiseki
    yuiseki 2006/05/04
  • PHP: DOM 関数 - Manual

    Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Su

    yuiseki
    yuiseki 2006/05/04
  • http://www.php.net/manual/ja/function.dom-domxpath-evaluate.php

    yuiseki
    yuiseki 2006/05/01
  • 1