If you are looking for PHP's strstr function in Javascript you can use following javascript function,
Reference : http://phpjs.org/functions/strstr/
function strstr(haystack, needle, bool) {
var pos = 0;
haystack += '';
pos = haystack.indexOf(needle);
if (pos == -1) {
return false;
} else {
if (bool) {
return haystack.substr(0, pos);
} else {
return haystack.slice(pos);
}
}
}
Reference : http://phpjs.org/functions/strstr/