PHP strstr stristr ある文字列が含まれるかどうか調べる 2010年06月11日 過去Blog $string = 'Hello World!'; if(stristr($string, 'earth') === FALSE) { echo '"earth" not found in string'; } // 出力は "earth" not found in string となります 参照元:http://www.php.net/manual/ja/function.st… この記事の続きを読む
PHPでサイトのタイトルを取得 2010年03月30日 過去Blog 参照元:http://creazy.net/2008/05/php_get_page_title_sample.html how to cure depression… この記事の続きを読む
PHP 日付の減算・差分を求める 2010年06月01日 過去Blog define( "ONE_DAY_SEC", 24 * 3600 ); // 日付けの差分をとる関数 function dateDiff( $date1, $date2 ) { return ( strtotime( $date1 ) - strtotime( $date2 ) ) / ONE_DAY_SEC; } // 実行サンプル $date1 = date('Y/m/d… この記事の続きを読む
PHP での SimpleXML 処理>>RSS取得 2009年12月05日 過去Blog phpでrssの情報を抜き出したい場合は、titleやlinkの要素は以下の通りで抜き出せます。 <?php // Load and parse the XML document $rss = simplexml_load_file('http://partners.userland.com/nytRss/nytHomepage.xml'); $title = $rss->channel->title; ?> … この記事の続きを読む
この投稿へのコメント
コメントはまだありません。