Jump to content

[SOLVED] Could someone help me understand this ===0


natepizzle

Recommended Posts

I understand '===0' means is exactly the same but i don't understand the return statement with that on the end. I saw this code snippet at http://www.jonasjohn.de/snippets/php/starts-with.htm and its dated back in 2007 so maybe its just old and not UTD with php 5. Maybe there is an implied if statement there saying return this line only if it is exactly equal to 0. Thanks for any help.

 

[cod]

 

function StartsWith($Haystack, $Needle){

    // Recommended version, using strpos

    return strpos($Haystack, $Needle) === 0;

   

}

 

[/cod]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.