<?php
function
strleft(
$leftstring
,
$length
) {
return
(
substr
(
$leftstring
, 0,
$length
));
}
function
strright(
$rightstring
,
$length
) {
return
(
substr
(
$rightstring
, -
$length
));
}
$myname
=
"John Miller"
;
echo
strleft(
$myname
,6);
//result "John M"
echo
strright(
$myname
,6);
//result "Miller"
?>
0 comments:
Post a Comment