Skip to content

Instantly share code, notes, and snippets.

View briankelleher's full-sized avatar
🏠
Working from home

Brian Kelleher briankelleher

🏠
Working from home
  • University of Connecticut
  • Storrs, CT
View GitHub Profile
@briankelleher
briankelleher / db-far.php
Last active October 2, 2017 19:49 — forked from KLicheR/db-far.php
PHP script that perform a find and replace in a database dump (tested with MySQL) with adjustments of the PHP serialize founded.
#!/usr/bin/php
<?php
/**
* PHP script that perform a find and replace in a database dump (tested with
* MySQL) with adjustments of the PHP serialize founded.
*
* Don't forget to escape your "special characters":
* "a$b" -> "a\$b"
* "a"b" -> "a\"b"
* "a`b" -> "a\`b"
@briankelleher
briankelleher / wp-modifydb.php
Created October 2, 2017 18:49 — forked from jcanfield/wp-modifydb.php
Serialized PHP Search and Replace
<?php
/**
*
* Safe Search and Replace on Database with Serialized Data v2.0.1
*
* This script is to solve the problem of doing database search and replace when
* developers have only gone and used the non-relational concept of serializing
* PHP arrays into single database columns. It will search for all matching
* data on the database and change it, even if it's within a serialized PHP
* array.