Skip to content

Instantly share code, notes, and snippets.

View tusharthe's full-sized avatar
🎯
Focusing

Tushar kanti tusharthe

🎯
Focusing
View GitHub Profile
function get_client_ip() {
$ipaddress = '';
if (isset($_SERVER['HTTP_CLIENT_IP']))
$ipaddress = $_SERVER['HTTP_CLIENT_IP'];
else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
else if(isset($_SERVER['HTTP_X_FORWARDED']))
$ipaddress = $_SERVER['HTTP_X_FORWARDED'];
else if(isset($_SERVER['HTTP_FORWARDED_FOR']))
$ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
<?php
$url2 = 'https://www.youtube.com/watch?v=M0oZG60WD9Y';
function convert_to_embeded($url) {
$body_array = preg_split("/\s+/", $url);
foreach($body_array as $key => $value) {
if(strpos($value, "www.youtube.com/watch?v=") !== false) {
<IfModule mod_rewrite.c>
RewriteEngine On
# !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
# slashes.
# If your page resides at
# http://www.example.com/mypage/test1
# then use
# RewriteBase /mypage/test1/
RewriteBase /test/
RewriteCond %{REQUEST_FILENAME} !-f