Function __global->starts_with

Definitions

sources/global2.php

  • Check if a string starts with a substring.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: bool

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$haystack string No No required parameter N/A N/A The haystack
$needle string No No required parameter N/A N/A The needle

Returns

  • Whether the haystack starts with the needle
  • Type: boolean
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Check if a string starts with a substring.
 *
 * @param  string $haystack The haystack
 * @param  string $needle The needle
 * @return boolean Whether the haystack starts with the needle
 */

function starts_with(string $haystack, string $needle) : bool