通过一次调用PHP调用2个函数

How can I call two functions from a single call in PHP?

function 1() {
  // do stuff
}

function 2() {
  // do other stuff
}

Then I want to call those 2 functions from a single call

(calling_functions_1_and_2($string));

How do I go about doing this?

Elaborated:

This function strips a string of any URL's

function cleaner($url) {
  $U = explode(' ',$url);

  $W =array();
  foreach ($U as $k => $u) {
if (stristr($u,'http') || (count(explode('.',$u)) > 1)) {
  unset($U[$k]);
  return cleaner( implode(' ',$U));
}
}
  return implode(' ',$U);
}

This function strips a string of any special characters, etc.

function clean($string) {
   return $string = preg_replace('/[^A-Za-z0-9\-\']/', '', $string); // Removes special chars.
}

The string that these functions perform on is in a JSON array.

So calling one of the functions

clean($searchResult['snippet']['title']); // wanting to remove all special characters from this string but not URL's.

But on this string below I do want to remove special characters and URLs, so how would I call both functions the most efficient and easiest way?

cleaner($searchResult['snippet']['description']);

Creating a function that calls both is a nice and simple way to do it:

function clean_both($string)
{
    return clean( cleaner( $string ) );
}

This way you just do the following to clean it both ways:

$clean_variable = clean_both( 'here is some text to be cleaned both ways' );

I would add a second parameter to one of the functions, let's take clean()

function clean($string,$urlRemove = false) {
       if ($urlRemove) {
          $string = cleaner($string);
       }
       return $string = preg_replace('/[^A-Za-z0-9\-\']/', '', $string); // Removes special chars.
    }

function cleaner($url) {
  $U = explode(' ',$url);

  $W =array();
  foreach ($U as $k => $u) {
if (stristr($u,'http') || (count(explode('.',$u)) > 1)) {
  unset($U[$k]);
  return cleaner( implode(' ',$U));
}
}
  return implode(' ',$U);
}

Having it like this, function clean() will default to only strip the url (when called like clean($string);), but if you call it like

clean($string,true);

you will have both functions beeing executed on the string.