Category: PHP Source Code


Start with PHP – PHP Code – Learn how to start index.php or other php       <?php // PHP code goes here ?>


PHP str_ireplace() String – PHP Code       <?php echo str_ireplace(“Horje”,”You”,”I love Horje”); ?>    


Auto Redirect HTTPS to full site – PHP Code   Find out header,php file from your script and copy following codes Past codes to very top in header,php       <?php if (!(isset($_SERVER[‘HTTPS’]) && ($_SERVER[‘HTTPS’] == ‘on’ || $_SERVER[‘HTTPS’] Read more…


Redirecting from HTTP to HTTPS with PHP on IIS – PHP Code       <?php if (! isset($_SERVER[‘HTTPS’]) or $_SERVER[‘HTTPS’] == ‘off’ ) { $redirect_url = “https://” . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’]; header(“Location: $redirect_url”); exit(); } ?>    


Auto Redirecting from HTTP to HTTPS with PHP – PHP Cod Open your index.php file and copy following codes and post in index.php on very top.       <?php if (!(isset($_SERVER[‘HTTPS’]) && ($_SERVER[‘HTTPS’] == ‘on’ || $_SERVER[‘HTTPS’] == 1) Read more…


Horizontal/Vertical table headings HTML Tables HTML Examples – HTML Code       <style> table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { padding: 5px; text-align: left; } </style> </head> <body> <h2>Horizontal Headings:</h2> <table style=”width:100%”> Read more…


PHP User online – PHP Code   In this tutorial, create 1 PHP file for testing this code.  user_online.php Steps Create table “user_online” in mysql in database “test”. Create file user_online.php.   STEP 1: Create table “user_online”     CREATE Read more…


There are options that users may set to change the browser’s default caching settings. By sending the headers above, you should override any of those settings and force the browser to not cache! Let the user be prompted to save Read more…


Write a PHP script to get the first word of a sentence. Original String : ‘The quick brown fox” Even though it is little late, but PHP has one better solution for this: Sample Solution: Using split function also you Read more…


You can show in page the last word of a sentence. It depends on what you try to do (it is hard to understand from your description) but to get the last word from a string you can do   Read more…

"