Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6012859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:27:54+00:00 2026-05-23T02:27:54+00:00

I am trying to fetch a mail in imap from Google, I’m using the

  • 0

I am trying to fetch a mail in imap from Google, I’m using the imap() function from PHP IMAP library and I want to use a preg_match() call on my mail content but I have a strange issue, I have curious break lines altering the normal preg_match().

More details:
I have in my markup something like that:

<TABLE CELLPADDING=5 RULES=GROUPS FRAME=BOX>

<THEAD>
<TR> <TH>Résumé points de classement</TH>       <TH>Extérieur</TH>            <TH>Domicile</TH> </TR>
</THEAD>

<TBODY>
<TR> <TD>Équipe</TD>                      <TD>Milan</TD>         <TD>Arsenal</TD> </TR>

<TR> <TD>Performance du match</TD>         <TD>0</TD>  <TD>19</TD> </TR>
<TR> <TD>Étoiles équipe</TD>         <TD>0</TD>   <TD>0</TD> </TR>
<TR> <TD>Points totaux</TD>              <TD>3195</TD>       <TD>3273</TD> </TR>

<TR> <TD>Niveau actuel</TD>       <TD>22</TD>   <TD>22</TD> </TR>
<TR> <TD>Points pour le prochain niveau</TD> <TD>5</TD>    <TD>127</TD> </TR>
</TBODY>

</TABLE>

I am running this code to extract the body for example:

<?php
// $message is the previous markup.
$str = substr($message, 321, 10);
var_dump($str);
$str = preg_replace("/&#10;/i","",$str);
var_dump($str);
?>

The output of this code is:

<pre class='xdebug-var-dump' dir='ltr'><small>string</small> <font color='#cc0000'>'
&#10;
&#10;&amp;lt;TABLE'</font> <i>(length=13)</i>
</pre>
<pre class='xdebug-var-dump' dir='ltr'><small>string</small> <font color='#cc0000'>'
&#10;
&#10;&amp;lt;TABLE'</font> <i>(length=13)</i>
</pre>

And the extracted value is an empty array… After further investigation i discovered through a var_dump() of my source string that there is a
at the end of each line.
I have no clue of what this html char code is and how to remove it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:27:54+00:00Added an answer on May 23, 2026 at 2:27 am

    Well the first thing is I’m assuming that you have run imap_mime_header_decode already and you have the result.

    Assuming you’re working in the UTF8 charset and not ISO-8859-1 or ISO-8859-15 charsets you can try

    utf8_encode($string);
    

    EDIT
    Whoops… to remove or replace the char you can use

    preg_replace('/&#10/','<alt>',$string);
    

    Just place your alternative character in where is. You can replace it with nothing by doing

    preg_replace('/&#10/','',$string);
    

    You can also run an array through preg_replace like

    $string = $myFile;
    $search = array('/&#10/','/sec/');
    $replace = array('','<alt>');
    preg_replace($search,$replace,$string);
    

    This may also be relevant to you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to fetch data from a div (based on his id), using PHP's
I am trying to fetch URLs using Google App Engine's urlFetch service and implement
I'm trying to use Ruby's IMAP library to get a list of all the
I'm trying to use $_SESSION['valid_user'] in a .php script that accesses the table mail
I'm trying to use Net::IMAP in Ruby to search all mail sent by me,
I'm trying to fetch data of some https website from google appengine (java). There
I'm trying to fetch random no. of entries from a database by using SELECT
I'm trying to fetch some HTML from various blogs and have noticed that different
I'm trying to fetch Wikipedia pages using LWP::Simple , but they're not coming back.
I'm trying to fetch some settings from my membership provider in my asp.net application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.