Программирование > PHP
функция stripos
			for_i_0:
			
			спасибо автору за ошибку
--- Цитировать ---kolyuchii.exe:
Fatal error: Call to undefined function: str_ireplace()
--- Конец цитаты ---
[off]тема закрыта[/off]
		
			AliMamed:
			
			c php.net
## HOMEBREW str_ireplace() FOR PRE-PHP 5.0
if (!function_exists(\'str_ireplace\')  {
  function str_ireplace($search,$replace,$subject) {
    $token = \'^[[term^]\';
    $haystack = strtolower($subject);
    $needle = strtolower($search);
    while (($pos=strpos($haystack,$needle))!==FALSE)  {
      $c++;
      $subject = substr_replace($subject,$token,$pos,strlen($search));
      $haystack = substr_replace($haystack,$token,$pos,strlen($search));
    }
    while (($pos=strpos($subject,$token))!==FALSE)  {
      $subject = substr_replace($subject,$replace,$pos,strlen($token));
    }
    return $subject;
  }
}
		
Навигация
Перейти к полной версии