I'm getting into compression algorithms and my native language is PHP, and I can understand that PHP is a language that you wouldn't normally make a big algorithm in, but I was wondering if it was possible. (of course it's possible - more so efficient and powerful)
The first type of algorithm I'd attempt to make is a simple adaptive algorithm, by taking in the most used bytes (chars) and converting them into binary types, (ex: a = 0001, b = 0010, c = 0011) - tho there is no real way to do that in PHP that I am familiar with, before this I was using simple ASCII conversions like a = chr(33), b = chr(34) that would get the least valued ASCII values use them as the smallest -> largest operators for the compression definitions.
So what I am asking is that if there's a way to assign binary values to a variable instead of it being represented as ASCII, if I go:
$string_after_compression = 000100100011;
#split it by 4 bits per = 0001 | 0010 | 0011
That would be interpreted as an int - therefore making an over-large int therefore most likely running out of available ram with a simple sentence, then if I try to store the value in a string instead, that removes the point of compressing as it's just making a string like:
$string_after_compression = "000100100011";
#split it by 4 bits per = "0001" . "0010" . "0011";
-----
This question is a bit confusing but the aim is: Is there a way to assign a PHP variable using a PHP intigers
Example solution:
$binary_var = (binary) 0001;
intfrom thedecbin / bindecfunctions. :-)