string contain

    1

    12

    stringjvitincludeβ€’β€’β€’
    JVIT PHP

    the string contains the another text

    Shortcut: str.contain

    /**
    * Determine if a string contains a given substring.
    *
    * @param  string  $haystack
    * @param  string  $needle
    * @return bool
    */
    public static function contains($haystack, $needle)
    {
      return $needle !== '' && self::strpos($haystack, $needle) !== false;
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.