Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Find the position of the first occurrence of a substring in a string
<?php strpos(string $haystack, string $needle, int $offset = 0): int|false
<?php unlink($tmp);
return (! $headers || strpos($headers[0], '404')) == false;
}
<?php $output = $this->runComposerCommand(...array_merge($parts, ['--format=json']));
$json = substr($output, strpos($output, "\n{"));
return json_decode($json);
}
<?php {
$filename = pathinfo($path, PATHINFO_FILENAME);
if (strpos($filename, '.') === false) {
return null;
}
<?php {
$path = pathinfo($path, PATHINFO_FILENAME);
if (strpos($path, '.') === false) {
return $path;
}
<?php {
$filename = pathinfo($path, PATHINFO_FILENAME);
if (strpos($filename, '.') === false) {
return null;
}
<?php $base = self::resolve(base_path());
$path = self::resolve($path);
if (strpos($path, $base) === 0) {
$path = str_replace($base, '', $path);
}
<?php $phpInfo = [];
foreach ($sections as $section) {
$heading = substr($section, 0, strpos($section, '</h2>'));
if (preg_match_all('#%S%(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?%E%#', $section, $matches, PREG_SET_ORDER) !== 0) {
<?php }
if (Str::contains($url, '?')) {
$url = substr($url, 0, strpos($url, '?'));
}
if (Str::endsWith($url, '/') && Str::length($url) > 1) {
<?php $anchor = is_null($fragment) ? '' : "#{$fragment}";
$character = (strpos($value, '?') !== false) ? '&' : '?';
$queryParam = "{$params[0]}=".($params[1] ?? '');
<?php foreach ($words as $word) {
if (strpos($word, '-') === 0 && strlen($word) >= $this->min_word_characters + 1) {
array_push($parts['disallowed'], substr($word, 1));
} elseif (strpos($word, '+') === 0 && strlen($word) >= $this->min_word_characters + 1) {
array_push($parts['required'], substr($word, 1));
<?php if (strpos($word, '-') === 0 && strlen($word) >= $this->min_word_characters + 1) {
array_push($parts['disallowed'], substr($word, 1));
} elseif (strpos($word, '+') === 0 && strlen($word) >= $this->min_word_characters + 1) {
array_push($parts['required'], substr($word, 1));
} elseif (strlen($word) >= $this->min_word_characters) {
array_push($parts['chunks'], $word);
<?php continue;
}
if (strpos($word, "'") !== false) {
array_push($output, preg_replace("/'/", '‘', $word));
array_push($output, preg_replace("/'/", '’', $word));
continue;
<?php continue;
}
if (strpos($word, '’') !== false) {
array_push($output, preg_replace('/’/', '‘', $word));
array_push($output, preg_replace('/’/', "'", $word));
continue;
<?php continue;
}
if (strpos($word, '‘') !== false) {
array_push($output, preg_replace('/‘/', "'", $word));
array_push($output, preg_replace('/‘/', '’', $word));
continue;
<?php if ($keyed) {
$temp_options = [];
foreach ($options as $value) {
if (strpos($value, ':')) {
[$option_key, $option_value] = explode(':', $value);
} else {