Click here to Skip to main content
15,915,093 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
AnswerRe: C++ Programming Pin
Richard MacCutchan24-Jun-10 4:58
mveRichard MacCutchan24-Jun-10 4:58 
GeneralRe: C++ Programming Pin
AmbiguousName24-Jun-10 5:03
AmbiguousName24-Jun-10 5:03 
AnswerRe: C++ Programming Pin
HimanshuJoshi3-Jul-10 2:43
HimanshuJoshi3-Jul-10 2:43 
AnswerRe: C++ Programming Pin
wbgxx6-Jul-10 22:20
wbgxx6-Jul-10 22:20 
AnswerRe: C++ Programming Pin
Anna-Jayne Metcalfe3-Aug-10 10:43
Anna-Jayne Metcalfe3-Aug-10 10:43 
AnswerRe: C++ Programming Pin
Ajay Bhausaheb Kedare21-Sep-10 0:40
Ajay Bhausaheb Kedare21-Sep-10 0:40 
AnswerRe: C++ Programming Pin
Iranian MM7-Sep-11 6:46
Iranian MM7-Sep-11 6:46 
Questionpreg_match_all Pin
Michiel Doe23-Jun-10 9:51
Michiel Doe23-Jun-10 9:51 
Hey guys,

For the last couple of hours i've been messing around with regex. I've never dared to lay my hands on this so please bare with me.

Basicly i'm trying to get some info from the following source
<random htmlcode here>
<td style="BORDER-RIGHT-STYLE:none;">
          <a id="dgWachtlijstFGI_ctl03_hlVolnaam" title="Klant wijzigen" class="wl" href="javascript: 

Pop(600,860,'klantwijzig','FrmKlant.aspx','?Wijzig=true&amp;lcSchermTitel=&amp;zoekPK=+++140+12++8',false,true); ">FIRST LINE A</a>
          &nbsp;(SECOND LINE A)<br>
          THIRD LINE A
        </td>
<random htmlcode here>
<td style="BORDER-RIGHT-STYLE:none;">
          <a id="dgWachtlijstFGI_ctl04_hlVolnaam" title="Klant wijzigen" class="wl" href="javascript: 

Pop(600,860,'klantwijzig','FrmKlant.aspx','?Wijzig=true&amp;lcSchermTitel=&amp;zoekPK=+++140+12++8',false,true); ">FIRST LINE B</a>
          &nbsp;(SECOND LINE B)<br>
          THIRD LINE B
        </td>
<random htmlcode here>


What i came up with this far is the following (thanks to rubular.com)

<?php 
$bestand = 'output.txt';
$fd = fopen($bestand,"r");
$message = fread($fd, filesize($bestand));
$regexp = "FrmKlant.aspx.*\">(.*)<\/a>\s(.*)<br>\s(.*)\s\s(.*)"; 

if(preg_match_all("#$regexp#siU", $message, $matches)) 
{ 
  print_r($matches);
}
?>


This actually seems to put the first and second line i need in a multidimensional array. So far so good, because i want a multidimensional array.
However, it doesn't seem to capture the 3rd line. And somehow it creates array[4]

[1] => Array ( [0] => FIRST LINE A [1] => FIRST LINE B ) 
[2] => Array ( [0] =>  (SECOND LINE A) [1] =>  (SECOND LINE B) ) 
[3] => Array ( [0] => [1] => ) [4] => Array ( [0] => [1] => )


What i'm looking for is this:
[0] => Array ( [0] => FIRST LINE A [1] => FIRST LINE B ) 
[1] => Array ( [0] =>  (SECOND LINE A) [1] =>  (SECOND LINE B) ) 
[2] => Array ( [0] => THIRD LINE A [1] => THIRD LINE B ) )


As you might have noticed, i'm lost! Any help would be greatly appreciated.
QuestionPHP Mail() function Pin
physicsworks17-Jun-10 4:50
physicsworks17-Jun-10 4:50 
AnswerRe: PHP Mail() function Pin
Dr.Walt Fair, PE17-Jun-10 5:09
professionalDr.Walt Fair, PE17-Jun-10 5:09 
AnswerRe: PHP Mail() function Pin
Peter_in_278017-Jun-10 16:42
professionalPeter_in_278017-Jun-10 16:42 
AnswerRe: PHP Mail() function Pin
cjoki18-Jun-10 5:11
cjoki18-Jun-10 5:11 
QuestionEncrypt with java and decrypt using C Pin
Murugan k16-Jun-10 19:38
Murugan k16-Jun-10 19:38 
AnswerCROSS-POST! Pin
enhzflep16-Jun-10 20:06
enhzflep16-Jun-10 20:06 
AnswerRe: Encrypt with java and decrypt using C Pin
LloydA11120-Jun-10 9:37
LloydA11120-Jun-10 9:37 
Questionhow to convert .pyc files to .py files in python Pin
kumarantechie16-Jun-10 18:49
kumarantechie16-Jun-10 18:49 
AnswerRe: how to convert .pyc files to .py files in python Pin
merridus17-Jun-10 5:31
merridus17-Jun-10 5:31 
GeneralRe: how to convert .pyc files to .py files in python Pin
kumarantechie17-Jun-10 19:50
kumarantechie17-Jun-10 19:50 
QuestionIdentity using mac address Pin
simpocoder15-Jun-10 21:15
simpocoder15-Jun-10 21:15 
AnswerRe: Identity using mac address PinPopular
cjoki16-Jun-10 4:16
cjoki16-Jun-10 4:16 
AnswerRe: Identity using mac address Pin
whatrevolution28-Jun-10 21:37
whatrevolution28-Jun-10 21:37 
Questionapache interface Pin
saqib_6046-Jun-10 14:41
saqib_6046-Jun-10 14:41 
AnswerRe: apache interface Pin
Jayapal Chandran26-Jul-10 7:56
Jayapal Chandran26-Jul-10 7:56 
QuestionPHP with ODBC Connectivity Pin
jayachandra.c4-Jun-10 19:37
jayachandra.c4-Jun-10 19:37 
AnswerRe: PHP with ODBC Connectivity Pin
cjoki6-Jun-10 9:52
cjoki6-Jun-10 9:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.