Created
January 11, 2016 08:55
-
-
Save Charlie-Lucas/c889d736fc713a8f15d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function redislize($data) | |
{ | |
// Only serialize if it's not a string or a integer | |
if(!is_string($data) && !is_integer($data)) | |
{ | |
return urlencode(serialize($data)); | |
} | |
// Encode string to escape wrong saves | |
return urlencode($data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment