Substr from character until character php
I have a problem is how substring from character until character in php.
I try this :
<?php
$str = "I love my family";
echo substr($str, 'm', strpos($str, 'y'));
?>
It will show error that :
A PHP Error was encountered
Severity: Warning
Message: substr() expects parameter 2 to be long, string given
Filename: pos_system/sale_detail.php
Line Number: 13
What I need is result : my family
No comments:
Post a Comment