Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php encrypting an integer to get only alphanumeric characters?

When I use some of php's encryption functions, I end up getting a few characters I don't want (+, /, =). The problem is that my application doesn't allow these in the url. I'm wondering if there's a good way of encrypting an integer and having only alphanumeric characters in the result? I'm trying to pass some data through the url. I know it's possible to do some workarounds (put data in database and pass the id to the row or something), but I really want to try it this way.

Ideas?

like image 904
Matthew Avatar asked Jun 27 '26 19:06

Matthew


1 Answers

You're looking for base_convert().

like image 182
Ignacio Vazquez-Abrams Avatar answered Jun 30 '26 07:06

Ignacio Vazquez-Abrams



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!