Parsování HTML tagů z textu

Uživatelský avatar
RoliD
Administrátor
Příspěvky: 250
Registrován: pát 10. črc 2015 12:47:18

Parsování HTML tagů z textu

Příspěvek od RoliD »

Pokud je potřeba z textu vytáhnout nějaké tagy, tak to uděláme takto:

Kód: Vybrat vše

$html = "Nějaký text <img src=odkaz> s obrázkem a odkazem <a href=odkaz>odkaz</a>";

$doc = new DOMDocument();
@$doc->loadHTML($html);

$tags = $doc->getElementsByTagName('img'); 
$links = $doc->getElementsByTagName('a');

foreach ($tags as $tag) {
       echo "<a href=\"".$tag->getAttribute('href')."\"><img src=".$tag->getAttribute('src')." ></a>";
}

Návštěvník

Re: Parsování HTML tagů z textu

Příspěvek od Návštěvník »

Air Jordan 6
Nike Outlet
Nike Jordan 1
Golden Goose Shoes
Air Jordans
Yeezy Sneakers
Red Bottom Shoes For Women
Nike Snkrs Website
Golden Goose
Red Bottoms Louboutin
Pandora
Jordan 3
NMD R1
Yeezy
Air Jordan 12
Jordan Retro 11 Mens
Ferragamo Outlet
Jordan Shoes
Jordan 11 GYM Red
Air Max 270
Christian Louboutin
Jordans 2021
Jordan Retro 12
Jordans Retro
Vans Store
Nike Factory Outlet
Pandora
Air Force 1
Air Max 90
Yeezys
Hermes Birkin Bag
Moncler Vest
Adidas Yeezy Boost 350
Jordan 6 Rings
Golden Goose Sneakers
Nike Outlet Store
Jordan 12
Cheap Nike Shoes
Air Jordan 11
Lebron Shoes
Nike Outlet Store Online Shopping
Nike Factory Outlet
Jordan Sneakers
Air Max 95
Jordan 1
Jordan Sneakers
Air Jordan 10
Pandora Bracelet Charms
Nike Sale
Jordan 4 Retro
Air Jordan 12
Air Jordan 3 Retro
Kyrie Irving Shoes
Louboutin Shoes
Soccer Cleats
Jordan Retro
Retro Jordans
Men's Nike Shoes
Jordan 1
Fjallraven Kanken
Jordan 11's
Pandora Charms Outlet
Jordan 5
Air Jordan Sneakers
Air Jordan Shoes
Nike Outlet
Moncler
Jordans 11
Yeezys
Golden Goose Sneakers Outlet
Golden Gooses Sneakers
Moncler Jackets For Women
Jordans 1s
Moncler Store
Pandora Charms
Air Max
Air Jordan 4
Jordan 11 For Sale
Nike Air Jordan 1s
Sneakers GGDB
Cheap Jordan Shoes
Air Jordan 1 Low
Air Jordan 1
NMD
Adidas Yeezy
Air Jordans
Nike Outlet Store Online
GGDB Shoes
Air Jordan 14
Moncler Jackets Outlet
Asics Running Shoes
Pandora Charms
Valentino Sneakers
Jordan 6 Retro
Golden Goose Mid Stars
Golden Goose Sneakers Women
Pandora Ring
Retro Jordan 11
Jordan 13 Retro
Jordans
Jordan 13s
Air Jordan 11s
Nike Shoes
Jordan Retro 11
Jordan Retro 4
Red Bottom Shoes
Yeezy
Jordan Shoes
Jordan 12 Retro
Jordans 5
Moncler Coats
Jordan 9
Air Jordan 6
Golden Goose Sneakers Sale
Air Jordan 11
Nike Official Website
Louboutin Shoes
Women Nike
Air Jordan Sneakers
Jordan 11 Low
Pandora Official Site
Christian Louboutin
Nike Outlet
Jordan 4
James Harden Shoes
Shoes GGDB
Nike Air Max 98
Air Jordan 8
Christian Louboutin Shoes
Balenciaga Triple S
Jordan 1 Retro
Pandora Jewelry
Balenciaga Sneakers
ECCO
Nike Jordan
New Jordan 11
Pandora Charms
Golden Goose Factory Outlet
Air Max 2018
Huaraches Nike
Pandora Rings
Jordan 1
New Jordans
Pandora Charms
Air Jordan Sneakers
Air Max
Fitflop Sandals
Air Jordan Retro
Jordan 4
Nike Air Max 270
Cheap Jordan Shoes
Air Jordan 5
Christian Louboutin shoes
New Nike Shoes 2021

Návštěvník

Re: Parsování HTML tagů z textu

Příspěvek od Návštěvník »

Pandora Jewelry Official Site
Pandora Jewelry
Jordan 15
Jordan 25
Wholesale Nikes
Jordans 12
Nike Wholesale Dealer
Pandora Rings Official Site
Nike Jordan 1
Jordan 26
Nike Zoom Fly
Lebron Shoes
Red Bottom
Adidas Yeezy
Jordan 33
Nike Shox
Cheap Jordans
Toddler Jordans
Nike Zoom
NBA Store Canada
Ice Jersey
Jordan 32
Cheap Nike Shoes From China Free Shipping
Cheap Jordans
Nike Huarache
Nike Huarache
Air Jordan 29
Nike Shoes For Women
Nike Shoes
Jordans 2021
Jordans 13
Nike Air Max
Nike Air Force 1
Nike React
Jordan 31
Nike
Nike Outlet
Nike Off White
Air Max 720
Rings Pandora
Nike Roshe
Huaraches Nike
Wholesale Air Jordans
Nike Running Shoes
Air Jordan
Nike Running Shoes Women
Nike Air Max 270 Flyknit
Jordan 17
Jordan 12
Nike
Pandora Charms
Nike Factory
Nike Metcons
Air Jordan 20
Nike Sneakers
Adidas Wholesale
Jordan 11 Concord
Air Max
Jordans 16
Air Max 97
Pandora Charms Outlet
Air Jordan 13
Nike Air Max 270
Pandora Jewelry
Pandora Bracelet
Nike Outlet
Pandora
Nike Outlet
Jordan 19
Jordans 34
Cheap Jordan Shoes
Nike Jordan
Nike SB Dunk
Jordan 2
Adidas Store
Jordan 1
Jordan 33
Nike
NMD
Adidas Wholesale Distributor
Cheap Adidas Shoes
MLB Jerseys
Wholesale Jordans
Jordan 33
Nike Sneakers
Nike Roshe Men
Nike Outlet Store Online Shopping
Jordan 35
Pandora Jewelry
Wholesale Jordans From China Factory
Nike Outlet Store
Nike Outlet Store Online Shopping
Jordan 6s
Nike Air Max 95 Essential
Nike Outlet Store Online Shopping
Adidas Yeezy Boost 350 V2
NFL Shop Online
Wholesale Nike Shoes
Pandora Jewelry
Cheap MLB Jerseys
Jordan Retros
Air Jordan Shoes
Pandora Jewelry
Air Jordan 11 Retro
Adidas Shoes
Pandora Jewelry 70 Off Clearance
Air Jordan 14
Pandora CZ Charms
Nike Foamposite
Nike Hyperdunk
Christian Louboutin
Nike Free Run
Nike Air Max
Jordan 30
Jordan 11
Jordan 27
Nike Shoes
Nike Air Max 97
Louboutin Shoes
Nike Shoes
Kids Jordans
MLB Jerseys
Nike Air Force 1 Mid
Pandora Jewelry Official Site
Nikes
Air Jordan 22
Air Jordan Shoes
Air Max 720
Jordans 24
Jordan Retro 11 Low
Nike Air Force 1
Pandora Bracelet Charms
Jordan 4
Air Force 1s
Nike Wholesale
Nike Shoes Cyber Monday Sales
Nike Women's Shoes
Jordan 18
Pandora Bracelet
Air Force Ones
Nike Clearance
Jordan 28
Pandora Bracelet
Official Nike Outlet Online Store
Jordan AJ 1
Air Max
Pandora Outlet
NHL Jerseys
Nike Shoes For Mens
What The Jordan 5s
Wholesale Clothing
Jordan 21
Dior Jordans
Nike Shoes Wholesale
Nike Store
New Nikes Shoes
Jordan 12 Retro
Jordans 23
Pandora Jewelry
Pandora Jewelry Outlet

Odpovědět

Zpět na “PHP”