public function text($text = null, $callback1 = null, $callback2 = null, $callback3 = null) { if (isset($text)) { return $this->html(htmlspecialchars($text)); } $args = func_get_args(); $args = array_slice($args, 1); $return = ''; foreach ($this->elements as $node) { $text = $node->textContent; if (count($this->elements) > 1 && $text) { $text .= "\n"; } foreach ($args as $callback) { $text = phpQuery::callbackRun($callback, array($text)); } $return .= $text; } return $return; }