나는 여기에서하려고하는 2 가지를 가지고있다. 그러나 나는 비참하게 실패하고 있으며 모든 것을 시도했기 때문에 그 이유를 모른다.PHP str_replace issues
본인이 저작권을 제거
str_replace
을 사용하려고하지만 이메일의 저작권 서명이 나타나고있다.몇 가지 이유로 메시지의 임의의 부분에 번호가 입력됩니다. 나는 이것이 왜 일어나고 있는지 정말로 혼란 스럽다. 아래는 PHP 코드와 HTML 출력의 모습입니다.
**** NEW 출력 : **** 나는 qprint을 추가하고 지금은 얻을 :
출력 :
코드 :
<?php
/* connect to gmail */
$hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
$username = '[email protected]';
$password = 'Password';
/* try to connect */
$inbox = imap_open($hostname, $username, $password) or die('Cannot connect to Gmail: ' . imap_last_error());
/* grab emails */
$emails = imap_search($inbox, 'ALL');
/* if emails are returned, cycle through each... */
if ($emails) {
/* begin output var */
$output = '';
/* put the newest emails on top */
rsort($emails);
/* for every email... */
foreach ($emails as $email_number) {
/* get information specific to this email */
$overview = imap_fetch_overview($inbox, $email_number, 0);
$message = imap_fetchbody($inbox, $email_number, 2);
$DateFormatted = str_replace("-0500", "", $overview[0] -> date);
/* output the email header information */
$output .= '<span class="msg_subject">' . $overview[0] -> subject . '</span> | ';
$output .= '<span class="msg_date"> ' . $DateFormatted . '</span><br />';
$bodyFormatted = str_replace("This e-mail (and attachment(s)) is confidential, proprietary, may be subject to copyright and legal privilege and no related rights are waived. If you are not the intended recipient or its agent, any review, dissemination, distribution or copying of this e-mail or any of its content is strictly prohibited and may be unlawful. All messages may be monitored as permitted by applicable law and regulations and our policies to protect our business. E-mails are not secure and you are deemed to have accepted any risk if you communicate with us by e-mail. If received in error, please notify us immediately and delete the e-mail (and any attachments) from any computer or any storage medium without printing a copy.
Ce courriel (ainsi que ses pièces jointes) est confidentiel, exclusif, et peut faire l’objet de droit d’auteur et de privilège juridique; aucun droit connexe n’est exclu. Si vous n’êtes pas le destinataire visé ou son représentant, toute étude, diffusion, transmission ou copie de ce courriel en tout ou en partie, est strictement interdite et peut être illégale. Tous les messages peuvent être surveillés, selon les lois et règlements applicables et les politiques de protection de notre entreprise. Les courriels ne sont pas sécurisés et vous êtes réputés avoir accepté tous les risques qui y sont liés si vous choisissez de communiquer avec nous par ce moyen. Si vous avez reçu ce message par erreur, veuillez nous en aviser immédiatement et supprimer ce courriel (ainsi que toutes ses pièces jointes) de tout ordinateur ou support de données sans en imprimer une copie.", "", $message);
/* output the email body */
$output .= '<span class="msg_body">' . $bodyFormatted . '</span><br /><br />';
}
echo $output;
}
/* close the connection */
imap_close($inbox);
?>
'임의의 문자열이'같다 :
다음은 수정 된 코드입니다. 그들은 무작위가 아니지만''','',''및 기타 악센트 문자의 인코딩 된 버전입니다. – Qqwy
악센트 부호가없는 곳에서 번호를 추가합니다. 예를 들어 – Bulvak
과 같은 원래의 이메일 : Wolfedale/Montreal 데이터 센터 (SDE)는 12 월 6 일/7 일 (Wolfedale) 및 12 월 12 일/13 일에 네트워크 유지 보수가 진행됩니다. (몬트리올). 이 유지 관리 중에는 중단 시간이 발생하지 않습니다. 범위 : 영향을받는 라우터에서 발견 된 문제로 인해 응급 네트워크 유지 관리가 필요합니다. 영향 : 미디어 인프라에서 호스팅되는 모든 웹 사이트 (향후 마이그레이션 예정) : – Bulvak