Mercurial > hg > fapweb
comparison msitegen.inc.php @ 803:ddb30c989b47
Add new helper function stSubStrCmp() for comparing substrings.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 23 Nov 2014 04:23:58 +0200 |
parents | ff6e6c6200a4 |
children | 2a23243a6cc4 |
comparison
equal
deleted
inserted
replaced
802:e5bbb01f2dd4 | 803:ddb30c989b47 |
---|---|
782 // echo "CREATE TABLE ".$name ." (".$schema.")\n"; | 782 // echo "CREATE TABLE ".$name ." (".$schema.")\n"; |
783 return (stDBExecSQL($dbh, "CREATE TABLE ".$name." (".$schema.")") !== FALSE) ? TRUE : FALSE; | 783 return (stDBExecSQL($dbh, "CREATE TABLE ".$name." (".$schema.")") !== FALSE) ? TRUE : FALSE; |
784 } | 784 } |
785 | 785 |
786 | 786 |
787 function stSubStrCmp($str, $cmp, $send = FALSE) | |
788 { | |
789 if ($send) | |
790 return substr($str, -strlen($cmp)) == $cmp; | |
791 else | |
792 return substr($str, 0, strlen($cmp)) == $cmp; | |
793 } | |
794 | |
795 | |
787 function stStrChop($str, $len) | 796 function stStrChop($str, $len) |
788 { | 797 { |
789 return (mb_strlen($str) > $len) ? mb_substr($str, 0, $len - 3)."..." : $str; | 798 return (mb_strlen($str) > $len) ? mb_substr($str, 0, $len - 3)."..." : $str; |
790 } | 799 } |
791 | 800 |