Warning: count(): Parameter must be an array or an object that implements Countable in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 820

Topic: del preg_match

Taigi nesigauna gauti teksto is html
stai kaip darau:

$data = "ilgas kodas.....<a href='index.php?in=4587'>xxx</a> ...end"
preg_match_all("~\/index.php?in=(.+?)'~i", $data, $gaunam);

taigi noriu gauti visus ?in= kodus bet kai taip darau rezultatas buna tuscias.
Ka blogai darau ;D

2 (edited by neturiuVardo 2011-07-25 20:49:01)

Re: del preg_match

preg_match_all("/index.php\?in=(.+?)\'>/", $data, $gaunam)

Na šitas turėtų veikt.

Avice wrote:

Taigi nesigauna gauti teksto is html
stai kaip darau:
$data = "ilgas kodas.....<a href='index.php?in=4587'>xxx</a> ...end"
preg_match_all("~\/index.php?in=(.+?)'~i", $data, $gaunam);
taigi noriu gauti visus ?in= kodus bet kai taip darau rezultatas buna tuscias.
Ka blogai darau ;D


Warning: count(): Parameter must be an array or an object that implements Countable in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 820

Re: del preg_match

preg_match('/(href[= = ])(.*?)(>)/i', 'ilgas kodas.....<a href=\'index.php?in=4587\'>xxx</a> ...end', $matches);

array (
  0 => 'href=\'index.php?in=4587\'>',
  1 => 'href=',
  2 => '\'index.php?in=4587\'',
  3 => '>',
)

Kazkas tokio

Re: del preg_match

Na jau randa bet kai naudoju:

$data = file_get_contents('URL');

$data visa graziai atvaizduoja , bet
jokio rezultato neranda su pattern'u kame beda?

5 (edited by aivaras37 2011-07-26 14:49:01)

Re: del preg_match

http://de2.php.net/manual/en/reference. … ifiers.php

m

Re: del preg_match

Dekui.
Jau pasigaminau gerai veikenti pattern'a ;]