Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- value1, value2, value3, value4 etc...
- $data["subscribers"];
- /* Remove value from comma seperated string */
- function removeFromString($str, $item) {
- $parts = explode(',', $str);
- while(($i = array_search($item, $parts)) !== false) {
- unset($parts[$i]);
- }
- return implode(',', $parts);
- }
- $newString = removeFromString($existArr, $userdata["id"]);
- function addtoString($str, $item) {
- $parts = explode(',', $str);
- $parts[] = $item;
- return implode(',', $parts);
- }
- $newString = addtoString($existArr, $userdata["id"]);
- function addToString($str, $item) {
- $parts = explode(',', $str);
- array_push($parts, $str);
- return implode(',', $parts);
- }
- $newString = addToString($existArr, $userdata["id"]);
- function addItem($str, $item) {
- return ($str != '' ? $str.',' : '').$item;
- }
Add Comment
Please, Sign In to add comment