タグ

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

  • PHP: rand - Manual

    オプションの引数 min,max を省略してコールした場合、rand() は 0 と getrandmax() の間の擬似乱数(整数)を返します。 例えば、5 から 15 まで(両端を含む)の乱数を得たい場合、 rand(5, 15) とします。 警告 この関数が生成する値は、暗号学的にセキュアではありません。そのため、これを暗号や、戻り値を推測できないことが必須の値として使っては いけません。 暗号学的にセキュアな乱数が必要な場合は、Random\Randomizer を Random\Engine\Secure と一緒に使いましょう。簡単なユースケースの場合、random_int() と random_bytes() 関数が、オペレーティングシステムの CSPRNG を使った、 便利で安全な API を提供します。 注意: (Windows のような)いくつかのプラットフォームでは、g

    PHP: rand - Manual
    MoneyReport
    MoneyReport 2016/10/06
    PHPで「1から180までの乱数を取得する」には rand(1, 180); でOK
  • PHP: explode - 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

    MoneyReport
    MoneyReport 2016/10/06
    PHPで文字列から「特定の文字列で分割し」て配列に一気に格納する関数_φ(・_・
  • PHP: file_put_contents - 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

    MoneyReport
    MoneyReport 2016/09/11
    1行でテキストファイルの出力可能。「FILE_APPEND」で追記も可能。
  • PHP: rename - 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

    MoneyReport
    MoneyReport 2016/08/30
    PHPのファイルリネーム関数_φ(・_・
  • PHP: はじめに - Manual

    MoneyReport
    MoneyReport 2016/08/13
    PHPをWindowsのコマンドライン上から動作させる方法。php.exeを叩けば、簡単にphpファイルをローカル内で使えるんだ!
  • PHP: filesize - 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

    MoneyReport
    MoneyReport 2016/07/21
    PHPでファイルサイズを取得する関数。
  • PHP: DateTime - 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

  • PHP: mb_convert_kana - 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

    MoneyReport
    MoneyReport 2015/06/09
    第三引数が肝だったとは・・・orz
  • PHP: PHP を使用する初めてのページ - Manual

    <!DOCTYPE html> <html> <head> <title>PHP Test</title> </head> <body> <?php echo '<p>Hello World</p>'; ?> </body> </html> ブラウザを使用して、/hello.php で終わる Web アクセス用 URL を指定し、 このファイルにアクセスしてください。 ローカルに開発を行っている場合、この URL は http://localhost/hello.php または http://127.0.0.1/hello.php のようになります。 しかし、これは Web サーバーの設定に依存します。 全てが正しく設定されている場合、 このファイルは PHP によりパースされ、以下の出力がブラウザに送信されます。 このプログラムは非常に簡単なので、実際には、このようなページを 作成するた

    PHP: PHP を使用する初めてのページ - Manual
    MoneyReport
    MoneyReport 2014/01/31
    PHPの基礎。ふむふむ。
  • 1