Skip to content

Instantly share code, notes, and snippets.

View ecorson's full-sized avatar

Erin Corson ecorson

  • University of Iowa
View GitHub Profile
@ecorson
ecorson / search_and_replace.php
Created April 3, 2012 14:32
Search and replace text using Views Bulk Operations
<?php
/**
* Search and replace using Views Bulk Operations
*/
$node = node_load($entity->nid); //load node form entity supplied by VBO
$haystack = $node->body['und'][0]['value']; //set node body to be haystack
$search = "Office of International Students and Scholars"; //Set the string to search for
$replace = "International Student & Scholar Services"; //String to replace target