Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Strip HTML and PHP tags from a string
<?php strip_tags(string $string, array|string|null $allowed_tags = null): string
<?php $output = stream_get_contents($this->output->getStream());
$output = Preg::replaceCallback("{(?<=^|\n|\x08)(.+?)(\x08+)}", function ($matches) {
$pre = strip_tags($matches[1]);
if (strlen($pre) === strlen($matches[2])) {
return '';
<?php if (!isset($size)) {
$size = strlen(strip_tags($stderr ? $this->lastMessageErr : $this->lastMessage));
}
$this->doWrite(str_repeat("\x08", $size), false, $stderr, $verbosity);
<?php $fill = $size - strlen(strip_tags($messages));
if ($fill > 0) {
$this->doWrite(str_repeat(' ', $fill), false, $stderr, $verbosity);
<?php public function install(InstalledRepositoryInterface $repo, InstallOperation $operation)
{
$this->installed[] = $operation->getPackage();
$this->trace[] = strip_tags((string) $operation);
$repo->addPackage(clone $operation->getPackage());
return null;
<?php public function update(InstalledRepositoryInterface $repo, UpdateOperation $operation)
{
$this->updated[] = array($operation->getInitialPackage(), $operation->getTargetPackage());
$this->trace[] = strip_tags((string) $operation);
$repo->removePackage($operation->getInitialPackage());
if (!$repo->hasPackage($operation->getTargetPackage())) {
$repo->addPackage(clone $operation->getTargetPackage());
<?php public function uninstall(InstalledRepositoryInterface $repo, UninstallOperation $operation)
{
$this->uninstalled[] = $operation->getPackage();
$this->trace[] = strip_tags((string) $operation);
$repo->removePackage($operation->getPackage());
return null;
<?php $package = $operation->getPackage();
$this->installed[] = $package;
$this->trace[] = strip_tags((string) $operation);
parent::markAliasInstalled($repo, $operation);
}
<?php public function markAliasUninstalled(InstalledRepositoryInterface $repo, MarkAliasUninstalledOperation $operation)
{
$this->uninstalled[] = $operation->getPackage();
$this->trace[] = strip_tags((string) $operation);
parent::markAliasUninstalled($repo, $operation);
}