Jump to content
php.lv forumi

preg_match_all


Uldis

Recommended Posts

Vajag no šī dabūt arā teksta daļu.

<h2>Anniversary Personalized Signature Platter</h2>

 

Izmantoju :

 

$adr="http://www.adrese.lv";
$str = file_get_contents($adr); 
preg_match_all("/h2\">(.*)<\/h2>/", $str, $str);
$rezultāts = $str[1][0];

, bet izskatās, ka kaut kas nav riktīgi. Nekad neesmu īsti izpratis preg_match_all - varbūt kāds uz ātru aci var pateikt kur problēma.

 

Paldies!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...