You are here

function my_callback in simplehtmldom API 5.2

Same name and namespace in other branches
  1. 6 simplehtmldom/example/example_callback.php \my_callback()
  2. 7 simplehtmldom/example/example_callback.php \my_callback()
1 string reference to 'my_callback'
example_callback.php in simplehtmldom/example/example_callback.php

File

simplehtmldom/example/example_callback.php, line 6

Code

function my_callback($element) {
  if ($element->tag == 'input') {
    $element->outertext = 'input';
  }
  if ($element->tag == 'img') {
    $element->outertext = 'img';
  }
  if ($element->tag == 'a') {
    $element->outertext = 'a';
  }
}