I have a string and I want to split it into 3 random-length parts (without caring about string length is the objective) to get 3 strings.
$mystring = "aHR0cHM6Ly93d3cucGhwLm5ldC9tYW51YWwvZW4vZnVuY3Rpb24uc3RyLXNwbGl0LnBocA==";
When I tried to use str_split(), I always have to manually set the number of character per string.
If I calculate the string length and divide it by 3, sometimes I get non-whole numbers.
$len = strlen($mystring);
$len = $len / 3;
$parts = str_split($mystring, $len);
print_r($parts);