I'm creating a standard 'framework' in PHP for my own projects. On this point I want to开发者_StackOverflow社区 have certain URL parameters encrypted. Those variables will not contain any data I need to hide from anyone. There are some restrictions.
- No security involved at all
- Decryption
- Basic characters only (A-Z,a-z,0-9)
- Optionally salt
- Optionally limit length
I've searched the internet, but all contained characters I did not prefer due to my htaccess standards. People that asked the same question often get point at security leaving no suitable answer in my case. Has anybody encountered this, and has a solution for this which I think must be basic? Many thanks in advance.
I think not everybody understands what you want ( including me ). You just want to make a "strange cool Url" ?
Replace a string with anything you want.
$string ="ace";
$letters =array( "a"=>'1',"b"=>'2',"c"=>'3',"d"=>'4',"e"=>'5');#etc.
$numbers = strtr($string, $letters);
## outputs : 135
EDIT : I think I figured out what you want.
Making a tiny url like youtube does.
Take a look here : http://kevin.vanzonneveld.net/techblog/article/create_short_ids_with_php_like_youtube_or_tinyurl/
精彩评论