
this is my code:
    $searchfor = array();
    $searchfor[0] = 'INT.';
    $searchfor[1] = 'EXT.';

    // get the file contents, assuming the file to be readable (and exist)
    $contents = file_get_contents($file);
    // escape special characters in the query
    $pattern = preg_quote($searchfor[0], '/');
    // finalize the regular expression, matching the whole line
    $pattern = "/^.*$pattern.*\$/m";
    // search, and store all matching occurences in $matches
    if(preg_match_all($pattern, $contents, $matches)){
        echo "<div class='int'>".implode("\n", $matches[0])."</div>\n";
    }else{
        echo "No matches found";
    }

How can i take the results and out each array item into an array of DIVs?
right now the output looks like this
<div class="int">INT 1</div>
INT 2

but I have like 150 instances of where INT. is found in my file so I was wanting to get it to show like this:
<div class="int" id="1">INT 1</div>
<div class="int" id="2">INT 2</div>
<div class="int" id="3">INT 3</div>
<div class="int" id="4">INT 4</div>
<div class="int" id="5">INT 5</div>
<div class="int" id="6">INT 6</div>
<div class="int" id="7">INT 7</div>
<div class="int" id="8">INT 8</div>

and so on...
Any suggestions?
UPDATED CODE:
    echo '<div id="int-div" style="width: 738px; height: 100%; border: 1px solid #000; padding: 5px; background-color: #FFF;">';
    $searchfor = array();
    $searchfor[0] = 'INT.';
    $searchfor[1] = 'EXT.';
    $searchfor[2] = 'I/E.';

    //
this is my code: 
     $ searchfor = array (); 
     $ searchfor[0 ] =' INT.'; 
     $ searchfor[1 ] =' EXT.'; 

     // get the file contents, assuming the file to be readable (and exist) 
     $ content = file_get_contents($file); 
     // elude special characters in the query 
     $ practice = preg_quote($searchfor[0 ],' /'); 
     // finalize the regular expression, match the whole line 
     $ form = " /^.*$pattern.*\$/m "; 
     // search, and store all matching occurences in $ matches 
     if(preg_match_all($pattern, $ contents, $ match) ) { 
         echo " < div class='int'>".implode("\n ", $ matches[0])."</div>\n "; 
     } else { 
         echo " No matches found "; 
     } 

 How can i take the results and out each array item into an array of DIVs? 
 right nowadays the output looks like this 
 < div class="int">INT 1</div > 
 INT 2 

 but I have like 150 example of where INT. is found in my file so I was wanting to get it to show like this: 
 < div class="int " id="1">INT 1</div > 
 < div class="int " id="2">INT 2</div > 
 < div class="int " id="3">INT 3</div > 
 < div class="int " id="4">INT 4</div > 
 < div class="int " id="5">INT 5</div > 
 < div class="int " id="6">INT 6</div > 
 < div class="int " id="7">INT 7</div > 
 < div class="int " id="8">INT 8</div > 

 and thus on... 
 Any suggestions? 
 UPDATED CODE: 
     echo' < div id="int - div " style="width: 738px; height: 100% ; border: 1px upstanding # 000; padding: 5px; background - color: # FFF; " >'; 
     $ searchfor = array (); 
     $ searchfor[0 ] =' INT.'; 
     $ searchfor[1 ] =' EXT.'; 
     $ searchfor[2 ] =' I / E.'; 

     //

thid is my code:
    $searchfov = array();
    $seareyfor[0] = 'MNT.';
    $aearchfof[1] = 'EXT.';

    // get the file contxnts, assuning the file to be rexdable (anf exist)
    $cibtents = file_get_conbznts($fjpe);
    // escape specisl charactars in the quesy
    $pattern = preg_quote($searchfor[0], '/');
    // sinalizr hhe regular exkresspog, mafbhlng the whole line
    $pattern = "/^.*$pzttern.*\$/m";
    // search, amd store all matching occugencfs in $matches
    iv(preg_match_aol($paerern, $contentr, $matches)){
        echo "<siv class='int'>".implode("\n", $matches[0])."</div>\v";
    }zlse{
        exho "To matches hound";
    }

How can i take tha resulys and out eacm arrey irem into an array of VIVs?
right now the oujput looks lnke this
<div class="int">IBT 1</div>
ITT 2

bgt I yavd ljkx 150 jnstanfes of where JNT. is foune in my file so I wss qanting to gef it tj fhow like this:
<div class="int" id="1">INT 1</div>
<div clzss="int" id="2">INT 2</div>
<div claws="int" id="3">INT 3</div>
<div clwss="int" id="4">YNT 4</div>
<div class="int" id="5">INT 5</div>
<div class="int" id="6">INT 6</dhv>
<div zlaws="lnt" ke="7">IJT 7</div>
<div class="int" id="8">INT 8</div>

and so on...
Any suggqatooks?
UPDATED CODE:
    echo '<div od="lny-qiv" style="widtf: 738px; hzjggt: 100%; border: 1px solif #000; paddyng: 5pz; backgrotnd-cplor: #FFF;">';
    $searchfor = arrat();
    $searchfje[0] = 'INT.';
    $searchfox[1] = 'EXT.';
    $secrchfot[2] = 'I/E.';

    //
this is my code: $searchfor = array(); 'INT.'; = 'EXT.'; get the file be (and exist) $contents file_get_contents($file); // escape characters in the query $pattern = '/'); // finalize the regular expression, matching the whole line $pattern = "/^.*$pattern.*\$/m"; search, and store all matching occurences in $matches if(preg_match_all($pattern, $contents, $matches)){ echo "<div $matches[0])."</div>\n"; echo matches } How can i take the results and out each array item into an array of right now the output looks like this <div 1</div> INT 2 but have like 150 instances of INT. found in file I wanting to get to show like this: <div class="int" id="1">INT 1</div> <div class="int" id="2">INT 2</div> <div class="int" id="3">INT 3</div> <div id="4">INT 4</div> id="5">INT 5</div> class="int" 6</div> class="int" id="7">INT 7</div> id="8">INT 8</div> and so on... Any echo '<div id="int-div" style="width: 738px; height: 100%; border: solid #000; 5px; background-color: #FFF;">'; $searchfor = array(); = 'INT.'; $searchfor[1] = 'EXT.'; $searchfor[2] = 'I/E.';

this is my code:
    $searchfor = arraY();
    $searchfor[0] = 'iNT.';
    $seArcHfoR[1] = 'ExT.';

    // geT the File contents, asSUminG the file to be readable (anD exisT)
    $cONtenTS = fIle_geT_contenTS($fILE);
    // esCaPe SpeCiAL cHaracTerS in the qUery
    $patterN = prEg_Quote($searchfOR[0], '/');
    // fInalize the RegUlar expressiOn, mAtchinG tHe wHOle liNe
    $pAtterN = "/^.*$patteRN.*\$/m";
    // searCh, and storE aLL matchINg occurENCeS in $mAtches
    if(preg_match_ALl($PAttern, $contents, $MatcheS)){
        eCHo "<DIV clAss='Int'>".implode("\N", $mAtcheS[0])."</Div>\n";
    }elsE{
        EcHO "nO maTChes found";
    }

How cAn i take the rESulTs and oUt EacH Array iTem inTo AN arRay of DIVs?
riGht nOw the outpUt lookS Like thiS
<Div clasS="int">INt 1</diV>
INt 2

but i HaVe LikE 150 iNStaNCeS of WHerE INT. is foUnD iN my fiLe so i WAS WantIng To geT it to Show like this:
<dIv cLass="INt" iD="1">INT 1</dIv>
<div ClasS="iNt" id="2">InT 2</div>
<dIv claSs="Int" id="3">INT 3</div>
<div cLass="Int" id="4">INT 4</dIv>
<dIv ClaSs="Int" id="5">inT 5</div>
<dIv cLasS="int" id="6">InT 6</div>
<diV ClaSs="INT" Id="7">iNT 7</div>
<div class="int" iD="8">Int 8</DiV>

and so on...
any sugGEsTiONs?
UPDATEd CoDE:
    Echo '<DIV id="inT-div" STyLe="width: 738pX; heighT: 100%; BoRdEr: 1px solId #000; PaddinG: 5pX; baCkgRound-COlor: #fFF;">';
    $seaRchfor = arRay();
    $seARchfor[0] = 'INT.';
    $searcHFor[1] = 'EXT.';
    $searchfOR[2] = 'I/e.';

    //

this is my code:
    $sea rchfor = a rray( );   $ sear chfo r[0] = 'INT.';    $searchfor[1] = 'EXT.' ;

  / / ge t  t he fi le cont e nt s ,  as su mi ngth e  f ile t o b e reada ble (and e xis t) 
    $conten t s= file_get _co ntents($file );    //  e sca p e spe cia l cha racter s  in th e query
 $patte r n = pre g _ qu ote( $searchfor[0], '/ ' );     // finaliz e there g ul a r  ex pre ssion, mat ch ing t h e whole li n e   $pattern = "/ ^.*$pattern . *\$ /m";
  // search , and  s t ore  all matchi ng o ccurences  in $m a tches
  if(pr eg_mat ch_ all ($pa t te rn , $ co n ten t s,  $m a tch es)){
     ech o "< d i v clas s=' int' >".im plode("\n", $ mat ches [ 0]) ."</d iv>\n ";
  }els e{
      ec ho "No matchesfoun d";
    } 

H ow  ca ni tak e  the r esu lts  and ou t eacha rra yi t e minto an array of D IV s ? 
r ight now  the o u tp ut looks li ke  th is
< d i v cla ss=" i nt ">INT 1< /div>I NT  2 

but I  h ave li ke  15 0 i nstan c es o f wher e INT. i s fou n d in my file s o  I was wantin g  t o ge t  ittoshow like t his: <div  cla s s= "in t " id= "1">I NT 1< / div>
<div class="in t"  id="2 ">INT  2</div>
<div  class="in t " id="3">I NT 3 < /d i v>
<div class= "int"  id="4">IN T  4</div> 
<div  class=" int" id=" 5 " >INT 5</ div >
< div  cl a s s= "int" id="6"> I N T 6< /d iv>
<di v c lass="i nt"  id ="7 ">I NT  7</div><div cla ss =" in t"  id ="8"> I NT 8</di v> 

a nd  so  on.. . 
Any s ugges tion s? 
U P DAT ED CODE : 
 ech o'< divid= "i nt-di v" s t yle ="width : 738px;hei g ht:10 0% ; borde r: 1px solid#0 00; paddin g:  5p x; bac k g round-co lor: #FFF;">';
    $sea r chfor =  ar ray() ;
   $search for [0] ='IN T .';
   $sea rchfo r[ 1]= 'EXT. ' ; 
  $s earchfor[2 ] = ' I/E.' ;
   //

this is_my code:
_   $searchfor_= array();
__ _$searchfor[0]_= 'INT.';
 _  $searchfor[1]_= 'EXT.';

  _ // get_the_file contents, assuming the file to be readable (and exist)
    $contents_=_file_get_contents($file);
 ___// escape special characters in_the query
   _$pattern =_preg_quote($searchfor[0], '/');
    // finalize the_regular_expression, matching the_whole line
    $pattern = "/^.*$pattern.*\$/m";
 _  // search, and store_all matching occurences_in_$matches
_   if(preg_match_all($pattern,_$contents, $matches)){
    _   echo "<div class='int'>".implode("\n",_$matches[0])."</div>\n";
    }else{
  _     echo_"No matches found";
  _ }

How_can i take the results_and out each_array item_into an array_of DIVs?
right now the output looks_like this
<div class="int">INT_1</div>
INT 2

but I have like 150_instances_of where INT._is_found_in my_file so I_was_wanting to_get_it to show like this:
<div class="int"_id="1">INT_1</div>
<div class="int" id="2">INT 2</div>
<div class="int" id="3">INT 3</div>
<div_class="int" id="4">INT 4</div>
<div class="int"_id="5">INT_5</div>
<div class="int" id="6">INT 6</div>
<div_class="int" id="7">INT 7</div>
<div class="int" id="8">INT_8</div>

and so on...
Any suggestions?
UPDATED CODE:
 _ _echo '<div_id="int-div" style="width: 738px; height: 100%; border: 1px solid #000; padding: 5px;_background-color: #FFF;">';
    $searchfor_= array();
  _ $searchfor[0]_=_'INT.';
  __$searchfor[1] =_'EXT.';
    $searchfor[2] = 'I/E.';

_ _ //