私はTwitterbotバックエンドアプリケーションで作業していますが、保存してから読むことができる文字列で直接メッセージをコピーしようとしています。 AIML(Artifical Intelligence Markup Language)エンジンに正常に統合したい場合PHP SimpleXML構文エラー
私はそれをテストするためのファイルを実行すると、私はパースエラーが出ます:
syntax error, unexpected T_VARIABLE referring to the line "file_put_contents('Program-O/InfoBot2012/test.xml', $direct_messages);"
私は、構文をチェックし、私はthisスレッドを追ったので、明らかな誤りがありません。
$connection = new TwitterOAuth($consumer_key,$consumer_secret, $oAuthToken, $oAuthSecret);
$direct_messages = $connection->get('direct_messages');
$direct_messages = file_get_contents('https://api.twitter.com/1/direct_messages.json')
file_put_contents('Program-O/InfoBot2012/test.xml', $direct_messages);
$direct_messages = simplexml_load_file("test.xml");
ますfile_put_contentsには、「$」を – mseancole
こんにちは、私は追加は必要ありません。あなたがPHPを設定したときは、それを有効にすることを忘れなかった - https 『を 「ラッパーを見つけることができません。警告:::のfile_get_contents()[function.file-getを-内容]』および$示唆したが、今私はさらに多くのエラーが出るなど"警告:file_get_contents(https://api.twitter.com/1/direct_messages.json)[function.file-get-contents]:ストリームを開けませんでした:C:\ wamp \ www \ Program- O \ InfoBot2012 \ directmessage_test.php "を参照してください$ direct_messages = file_get_contents( 'https://api.twitter.com/1/direct_messages.json'); –
これらの他のエラー: "警告:file_put_contents(Program-O/InfoBot2012/test.xml)[function.file-put-contents]:ストリームを開くことに失敗しました:C:\ wamp \ wwwにそのようなファイルまたはディレクトリはありません\ Program-O \ InfoBot2012 \ directmessage_test.php "を参照してください。file_put_contents( 'Program-O/InfoBot2012/test.xml'、$ direct_messages); "警告:simplexml_load_file()[function.simplexml-load-file]:I/O警告:外部エンティティ" test.xml "をC:\ Wamp \ www \ Program-O \ InfoBot2012 \ directmessage_testに読み込めませんでした。コードラインを参照する "php" $ direct_messages = simplexml_load_file( "test.xml"); –