-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclearCodeVideo.txt
More file actions
30 lines (29 loc) · 835 Bytes
/
Copy pathclearCodeVideo.txt
File metadata and controls
30 lines (29 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function clearCodeVideo($codigo = null, $streaming = null)
{
if ($codigo && $streaming) {
switch ($streaming) {
case 2:
$codigo = str_replace(
array(
'https://vimeo.com/',
'https://player.vimeo.com/video/'
),
'',
$codigo
);
break;
case 1:
$codigo = str_replace(
array(
'https://www.youtube.com/watch?v=',
'https://youtu.be/',
'https://www.youtube.com/embed/'
),
'',
$codigo
);
break;
}
}
return $codigo;
}