|
Posted by David Haynes on 01/25/06 20:27
T.Taylor wrote:
> I am new to PHP so I thought I would make a Reference List of some of
> the functions.
> Below is what I have so far.
>
>
>
> ASP Functions PHP Functions
> ==================== ===============
> Left(str,length) substr(str,start,length)
> Right(str,length) substr(str,start,length)
> Mid(str,start,stop) substr(str,start,length)
> Len(str) strlen(str)
> Trim(str) trim(str)
> LTrim(str) ltrim(str)
> RTrim(str) rtrim(str)
> UCase(str) strtoupper(str)
> LCase(str) strtolower(str)
> InStr(str,value) ---DON'T KNOW---
>
It might be clearer as follows:
Left(str, length) <=> substr(str, 0, length)
Right(str, length) <=> substr(str, strlen(str)-length)
Mid(str, start, stop) <=> substr(str, start, (stop-start+1))
You could always create a function to match the ASP one:
function Left($str, $length) {
return substr($str, 0, $length);
}
and so on...
-david-
Navigation:
[Reply to this message]
|