Anyone knows what error this is?

Warning: preg_replace(): Compilation failed: missing ) at offset 27 in c:\inetpub\wwwroot\review.php on line 429

The errors are coming from those lines below

$aircraftType  =  $row['1'];       
$aircraftTailNo = preg_replace($trimmed_arrayKeyword, '<b>\\1</b>' , $row['2']); $airFrameHours = $row['3']; $servicingType = $row['4']; $date = explode('-', $row['5']); $actual_date = $date[2].'-'.$date[1].'-'.$date[0]; $defectInfo = preg_replace($trimmed_arrayKeyword, '<b>\\1</b>' , $row['6']); $rectifications = preg_replace($trimmed_arrayKeyword, '<b>\\1</b>' , $row['7']); $comments = preg_replace($trimmed_arrayKeyword, '<b>\\1</b>' , $row['8']); $relatedDoc = preg_replace($trimmed_arrayKeyword, '<b>\\1</b>' , $row['9']);

    You need to take a look at $trimmed_arrayKeyword, of course.

      I'm sorry hope this would help

      Warning: preg_replace(): Compilation failed: missing ) at offset 27 in c:\inetpub\wwwroot\sip\review.php on line 427
      Warning: preg_replace(): Compilation failed: missing ) at offset 27 in c:\inetpub\wwwroot\sip\review.php on line 432 to Line 435

      Line 432 to Line 435
      Line 432 - $date = explode('-', $row['5']);
      Line 433 - $actual_date = $date[2].'-'.$date[1].'-'.$date[0];
      Line 434 - $defectInfo = preg_replace($trimmed_arrayKeyword, '<b>\1</b>' , $row['6']);
      Line 435 - $rectifications = preg_replace($trimmed_arrayKeyword, '<b>\1</b>' , $row['7']);

      $Keyword = (isset($_GET['Keyword'])) ? $_GET['Keyword'] : '';
      $trimmedKeyword = trim($Keyword);
      $trimmedKeyword = preg_replace('#\s+#',' ', trim($trimmedKeyword));//trim extra whitespaces from the stored variable
      $trimmed_arrayKeyword = explode(" ",$trimmedKeyword);
      
      foreach ($trimmed_arrayKeyword as $trimmKeyword => $word){
      if(strtolower($word)){
      $trimmed_arrayKeyword[$trimmKeyword] = "/\b(?<!<)($word)(?!>)\b/i";
      }//end if
      else $trimmed_arrayKeyword[$trimmKeyword] = '/\b('.preg_quote($word,'/').')\b/i'; 
      
      while ($row = mysql_fetch_array($resultAircraftDisplay)) { 
      $aircraftType     =  $row['1'];       
      $aircraftTailNo = preg_replace($trimmed_arrayKeyword, '<b>\\1</b>' , $row['2']); $airFrameHours = $row['3']; $servicingType = $row['4']; $date = explode('-', $row['5']); $actual_date = $date[2].'-'.$date[1].'-'.$date[0]; $defectInfo = preg_replace($trimmed_arrayKeyword, '<b>\\1</b>' , $row['6']); $rectifications = preg_replace($trimmed_arrayKeyword, '<b>\\1</b>' , $row['7']); $comments = preg_replace($trimmed_arrayKeyword, '<b>\\1</b>' , $row['8']); $relatedDoc = preg_replace($trimmed_arrayKeyword, '<b>\\1</b>' , $row['9']);

        Anyone knows which part of the codes is causing such problem

          laserlight already told you it's the stuff you're putting into preg_replace().

            Write a Reply...