Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Doncrawler - filter
Pyton_000
post
Post #1





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


Mam sobie HTML:

  1. <div>
  2. <div>
  3. <p>
  4. <pre>Test</pre>
  5. </p>
  6. <p>
  7. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab architecto esse harum illo iste modi mollitia obcaecati repudiandae suscipit unde! Architecto atque blanditiis dignissimos dolorem molestiae quia recusandae sunt tenetur.
  8. </p>
  9. <pre>
  10. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad aliquid atque consectetur deserunt dolorem doloremque earum hic illum impedit ipsa ipsam molestias nihil non quasi quidem repellat, soluta suscipit unde.
  11. </pre>
  12. </div>
  13. </div>


Chciałbym zrobić sobie filter na 'pre' a konkretnie chcę zrobić htmlentities. Jednak nie chcę wyciągać samego pre ale "zamienić" oryginalne "pre" na przefiltrowane.

Jakiś prosty i szybki sposób?

To co mam:
  1. $crawler = new Crawler($content);
  2.  
  3. $crawler->filter('pre > code')->each(function(Crawler $node, $i) {
  4. return htmlentities($node->html());
  5. });
Go to the top of the page
+Quote Post

Posty w temacie
- Pyton_000   Doncrawler - filter   31.12.2015, 14:19:14
- - kpt_lucek   Może tak?   31.12.2015, 14:22:43
- - Pyton_000   Przecież to robi dokładnie to samo... tylko inacze...   31.12.2015, 14:36:46


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 25.08.2025 - 16:20