|
Posted by Justin Koivisto on 01/25/06 21:45
T.Taylor wrote:
> The stop parameter is the last character's position not the length.
>
> Example:
> =======
> str="hello"
> Mid(str,2,4) would equal "ell"
In that case Mid is this:
substr($str,$start-1,$stop-$start+1);
....or use this:
function Mid($str,$first,$last){
return substr($str,$first-1,$last-$first+1);
}
> InStr is function that returns the start position in a string where it
> found the value otherwise is returns 0
function InStr($str,$search){
if(FALSE===$x=strpos($str,$search)){
return 0;
}else{
return $x+1;
}
}
--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com
[Back to original message]
|