$open_email_msg を検索するスクリプトを取得しようとしていますが、電子メールによって情報は異なりますが、以下と同じ形式になります。Title: または Tags: または Categories: の後に置くものは何でも欲しいだけです。そのデータがキャプチャされるものは何でも、文字列 "Title:" または "Tags:" または "Categories:" ではありません これはコード全体の単なるスニペットです。残りは情報を MySQL テーブルに挿入し、サイトのニュース記事に投稿します。
誰かがこれに対する解決策を見つけるのを手伝ってくれますか?
厳密な電子メール メッセージ形式:
ニュース更新の
タイトル: 記事のタイトル
タグ: tag1 tag2
カテゴリ: 記事のカテゴリ、2 番目の記事のカテゴリ
スニペット: 記事のスニペット。
メッセージ: 記事のメッセージ。画像。より多くのテキスト、より多くのテキスト。Lorem impsum dolor sit amet.
<?php
//These functions searches the open e-mail for the the prefix defining strings.
//Need a function to search after the space after the strings because the subject, categories, snippet, tags and message are constant-changing.
$subject = strpos($open_email_msg, "Title:"); //Searches the open e-mail for the string "Title"
$categories = strpos($open_email_msg, "Categories:"); //Searches the open e-mail for the string "Categories"
$snippet = strpos($open_email_msg,"Snippet"); //Searches the open e-mail for the string "Snippet"
$content = strpos($open_email_msg, "Message"); //Searches the open-email for the string "Message"
$tags = str_replace(' ',',',$subject); //DDIE
$uri = str_replace(' ','-',$subject); //DDIE
$when = strtotime("now"); //date article was posted
?>