rausis Posted November 24, 2008 Report Share Posted November 24, 2008 ar file_get_contents() nolasu lapas saturu, kā rezultātā sanāk kkas tāds: <table width="100%" border="0" align="center" cellpadding="2" cellspacing="0"> <tr> <td align=center width=110>1</td> <td align=left>2</td> <td align=center> </td> <td align=center>3</td> </tr> <tr> <td align='center'>2008-11-19 02:32:47</td> <td>3</td> <td align='center'>3</td><td> </td></tr></table> Vajag izgriezt ārā datumu, lai tas sanāk bez nekāda html, tikai 2008-11-19 02:32:47 kā ko tādu panākt? spēlējos ar preg_match un explode, bet sapratu, ka tie patterni iekš preg_match priekš manis ir par grūtu un neizprotamu, varbūt kāds var palīdzēt, dot kādu domu graudu :) Paldies! Link to comment Share on other sites More sharing options...
andrisp Posted November 24, 2008 Report Share Posted November 24, 2008 \d{4}\-\d{2}\-\d{2}\s\d{2}:\d{2}:\d{2} Link to comment Share on other sites More sharing options...
rausis Posted November 24, 2008 Author Report Share Posted November 24, 2008 preg_match("/\d{4}\-\d{2}\-\d{2}\s\d{2}:\d{2}:\d{2}/", $string, $match); Liels paldies, šādi viss strādā :) Link to comment Share on other sites More sharing options...
marrtins Posted November 24, 2008 Report Share Posted November 24, 2008 Ja tas kods daudzmaz valīds, var iebarot kā xml un apstaigāt jau kā DOM koku. Link to comment Share on other sites More sharing options...
Recommended Posts