first
This commit is contained in:
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\Framework\Misc\StringPhp;
|
||||
|
||||
class MultiByte implements StringInterface {
|
||||
|
||||
public function strpos($haystack, $needle, $offset = 0) {
|
||||
return mb_strpos($haystack, $needle, $offset);
|
||||
}
|
||||
|
||||
public function substr($string, $start, $length = null) {
|
||||
return mb_substr($string, $start, $length);
|
||||
}
|
||||
|
||||
public function strlen($string) {
|
||||
return mb_strlen($string);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\Framework\Misc\StringPhp;
|
||||
|
||||
class SingleByte implements StringInterface {
|
||||
|
||||
public function strpos($haystack, $needle, $offset = 0) {
|
||||
return strpos($haystack, $needle, $offset);
|
||||
}
|
||||
|
||||
public function substr($string, $start, $length = null) {
|
||||
return substr($string, $start, $length);
|
||||
}
|
||||
|
||||
public function strlen($string) {
|
||||
return strlen($string);
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\Framework\Misc\StringPhp;
|
||||
|
||||
|
||||
interface StringInterface {
|
||||
|
||||
public function strpos($haystack, $needle, $offset = 0);
|
||||
|
||||
public function substr($string, $start, $length = null);
|
||||
|
||||
public function strlen($string);
|
||||
}
|
Reference in New Issue
Block a user