2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * @package phpMyAdmin-Transformation
11 function PMA_transformation_text_plain__substr($buffer, $options = array(), $meta = '') {
12 // possibly use a global transform and feed it with special options:
13 // include './libraries/transformations/global.inc.php';
15 // further operations on $buffer using the $options[] array.
16 if (!isset($options[0]) ||
$options[0] == '') {
20 if (!isset($options[1]) ||
$options[1] == '') {
24 if (!isset($options[2]) ||
$options[2] == '') {
29 if ($options[1] != 'all') {
30 $newtext = PMA_substr($buffer, $options[0], $options[1]);
32 $newtext = PMA_substr($buffer, $options[0]);
35 $length = strlen($newtext);
36 $baselength = strlen($buffer);
37 if ($length != $baselength) {
38 if ($options[0] != 0) {
39 $newtext = $options[2] . $newtext;
42 if (($length +
$options[0]) != $baselength) {
43 $newtext .= $options[2];