preg_replace('!(http://|ftp://)!', 'https://', $value);
Long story: Regexp needs to be enclosed in delimiters, and those have to be unique inside the whole regexp. If you want to use /, then the remaining /-s inside the regexp need to be escaped. This however makes the syntax look a bit ugly. Luckily you can use any character as delimiter. ! works fine, as will other characters.
The rest of the regexp just lists two options, either of which will be replaced with the second parameter.