[Users] strip_tail() string length?

Daniel-Constantin Mierla daniel at voice-system.ro
Mon Feb 5 11:37:29 CET 2007


Stripping is now possible with the new introduced 'transformations':
http://openser.org/dokuwiki/doku.php/transformations:devel

So if you want to strip last two characters of username in R-URI

$var(x) = $(rU{s.len})-2;
$rU = $(ru{s.substr,0,$var(x)});

Cheers,
Daniel


On 01/30/07 09:08, Juha Heinanen wrote:
> Brandon Armstead writes:
>
>  > i.e. strip_tail(strlen($ru) - 2); ... or something like such.
>
> sorry, but my suggestion
>
> substr($ru, -2, 2)
>
> does not work, since it returns the last two chars of $ru not the
> remaining chars.  strlen is indeed needed for the above.  using php
> substr and strlen
>
> strip_tail(strlen($ru) - 2)
>
> becomes
>
> substr($ru, 0, strlen($ru) - 2)
>
> -- juha
>
> _______________________________________________
> Users mailing list
> Users at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/users
>
>   




More information about the Users mailing list