Skip to main content
simplify according to comment
Source Link
Mykola Semenov
  • 802
  • 3
  • 13
  • 21

A string can be checked with the below function:

function either_String_existor_not($str, $character) {
    if (strpos($str, $character) !== false) {
        return true;
    }
    return false;
}
function either_String_existor_not($str, $character) {
    return strpos($str, $character) !== false;
}

A string can be checked with the below function:

function either_String_existor_not($str, $character) {
    if (strpos($str, $character) !== false) {
        return true;
    }
    return false;
}

A string can be checked with the below function:

function either_String_existor_not($str, $character) {
    return strpos($str, $character) !== false;
}
Post Made Community Wiki by samliew
deleted 31 characters in body
Source Link
Charles Clayton
  • 18.3k
  • 15
  • 94
  • 123

A string can be checked with the below function:

function either_String_existor_not($str, $character) {
    if (strpos($str, $character) !== false) {
        return true;
    }
    else {
        return false;
    }
}

A string can be checked with the below function:

function either_String_existor_not($str, $character) {
    if (strpos($str, $character) !== false) {
        return true;
    }
    else {
        return false;
    }
}

A string can be checked with the below function:

function either_String_existor_not($str, $character) {
    if (strpos($str, $character) !== false) {
        return true;
    }
    return false;
}
Copy edited.
Source Link
Peter Mortensen
  • 31.1k
  • 22
  • 111
  • 134

StringA string can be checked with the below function:

function either_String_existor_not($str, $character) {
    if (strpos($str, $character) !== false) {
        return true;
    }
    else {
        return false;
    }
}

String can be checked with the below function

function either_String_existor_not($str,$character){
    if (strpos($str,$character) !== false) {
        return true;
    } else{
        return false;
    }
}

A string can be checked with the below function:

function either_String_existor_not($str, $character) {
    if (strpos($str, $character) !== false) {
        return true;
    }
    else {
        return false;
    }
}
Source Link
M Razwan
  • 257
  • 3
  • 12
Loading