-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfunctions.php
More file actions
34 lines (30 loc) · 831 Bytes
/
functions.php
File metadata and controls
34 lines (30 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/**
* This provides a user-interface for using the DbDiff class.
*
* More information on this tool can be found at:
* http://joefreeman.co.uk/blog/2009/07/php-script-to-compare-mysql-database-schemas/
*
* Copyright (C) 2009, Joe Freeman <joe.freeman@bitroot.com>
* Available under http://en.wikipedia.org/wiki/MIT_License
*/
/**
* Strips new line characters (CR and LF) from a string.
*
* @param string $str The string to process.
* @return string The string without CRs or LFs.
*/
function strip_nl($str) {
return str_replace(array("\n", "\r"), '', $str);
}
/**
* Returns an 's' character if the count is not 1.
*
* This is useful for adding plurals.
*
* @return string An 's' character or an empty string
**/
function s($count) {
return $count != 1 ? 's' : '';
}
?>