function uikit_file_str_replace

8.x-3.x uikit.drush.inc uikit_file_str_replace($file_path, $find, $replace)
8.x-2.x uikit.drush.inc uikit_file_str_replace($file_path, $find, $replace)
7.x-3.x uikit.drush.inc uikit_file_str_replace($file_path, $find, $replace)
7.x-2.x uikit.drush.inc uikit_file_str_replace($file_path, $find, $replace)

Replace strings in a file.

File

uikit.drush.inc, line 233
Drush integration of UIkit.

Code

function uikit_file_str_replace($file_path, $find, $replace) {
  $file_path = drush_normalize_path($file_path);
  $file_contents = file_get_contents($file_path);
  $file_contents = str_replace($find, $replace, $file_contents);
  file_put_contents($file_path, $file_contents);
}

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

Log in