How to Get Title, Description, and Keywords of a Website in PHP ?

PHP website metadata extraction image

I found most of the people asking for a way to get meta data of a website, so I thought to share the logic with a very easy PHP script that will retrieve a website page title, keywords and description. You can also get the sitemap of a website url. Here I am describing it with proper UI and with output. So follow these steps. Step #1 : First design a page where you can input website URL. Copy index.php Code :- <form action=”show.php” method=”POST”>     <table cellspacing=”0″ height=”38%”…

How to Create a Simple Stored Procedure in mysql?

MySQL stored procedure tutorial image

What is a Stored Procedure? A stored procedure is a set of SQL statements that form a logical unit to perform a specific task. It encapsulates a group of operations or queries executed on a database server. Why Use Stored Procedures? Stored procedures isolate the client from implementation details and the underlying schema. They also reduce network traffic by executing SQL statements in batches, minimizing multiple client requests. Syntax: DELIMITER $$ CREATE PROCEDURE `simpleprocedure`(IN name varchar(50), IN user_name varchar(50), IN branch varchar(50)) BEGIN INSERT INTO student (name, user_name, branch) VALUES…

7 Best Free & Open source Video CMS For Sharing Videos

Free video CMS platforms image

0pen s0urce vide0 cms built 0n 0pen s0urce c0de is a platf0rm that pr0vides a c0ntent management system just like p0pular W0rdPres but f0r Vide0s. Y0uTube and Vime0 are the best examples 0f Vid0e CMS. But if y0u want t0 run y0ur 0wn vide0 bl0g t0 share the vide0 y0u can g0 f0r self-h0sted vide0 CMS. The best vide0 CMS sh0uld have     Inbuilt security     SE0 0ptimati0n     Light and speedy     Tracking system     Updates There are s0me best 0pen s0urce vide0 CMS that helps y0u built y0ur…

how to search a specific word in a string in php?

PHP string manipulation tutorial image

You can use the strpos function which is used to find the occurrence of one string inside other strpos() : strpos() function — Find the position of the first occurrence of a substring in a different string It’s support (PHP 4, PHP 5, PHP 7).     Syntax : mixed strpos ( string $haystack , mixed $needle [, int $offset = 0 ] ) Find the numeric position of the first occurrence of needle in the haystack string. Parameters : haystack    The string to search in.   needle    If needle is not a string, it is converted to an integer and applied as the ordinal value of a character.  …

How to count the number of substring occurrences in a string ?

PHP string manipulation tutorial image

Common PHP issue that mostly developer face. below is the solution for such type of issue.. substr_count substr_count — Count the number of substring occurrences int substr_count ( string $haystack , string $needle [, int $offset = 0 [, int $length ]] ) substr_count() returns the number of times the needle substring occurs in the haystack string. Please note that needle is case sensitive. Note: This function doesn’t count overlapped substrings. See the example below! Parameters ¶ haystack The string to search in needle The substring to search for offset The offset where to start counting. If the offset is negative, counting starts from the end of the string. length The maximum length after the…

How to remove everything before a specific first character?

PHP string manipulation tutorial image

Sometime developers are facing the issue of eliminating all characters before the first specific character. Here I am describing how you can remove all the characters before a specific thing. Just suppose we have a string as below:- <?php     $str = ‘http://blog.phpmypassion.com’;  ?> Now If I want to get my main domain then I have to follow below code.. <?php if(($pos = strpos($str, ‘.’)) !== false) {    $new_str = substr($str, $pos + 1); } else {    $new_str = get_last_word($str); } echo ‘new string will be=’.$new_str; ?>…

How do control browser caching?

Browser caching control guide image

image source: techstream.org I faced browser caching issue for my website from last 4-5 days. I had a lot of research to resolve it but my website always loaded from browser cache. It was not loading from server until I refreshed it. If I refreshed URL, it loaded from server with my updated changes. After spending 2-3 days on analyzing this issue, I found the solution for this. I want to share this post by that in future no body will face this type of problem. What is browser cache?…

PHP 7.1 has been released!

PHP 7.1 release features image

The PHP development team announces the immediate availability of PHP 7.1.0, the first point release in the 7.x series. New Features PHP 7.1.0 introduces several new features and improvements, including: Nullable Types: Support for nullable types in function signatures. Void Return Type: Functions can now explicitly declare a void return type. Iterable Pseudo-Type: A new pseudo-type for functions accepting iterables. Class Constant Visibility Modifiers: Constants can now have public, private, or protected visibility. Square Bracket Syntax for list(): Enhanced list() destructuring with square bracket syntax and key specification. Catching Multiple…

How to Add a Domain in your hosting cPanel?

cPanel add domain tutorial image

Creating a subdomain for your hosted domain can be daunting if you’re unfamiliar with server management. This guide shares a step-by-step process for creating a subdomain on a GoDaddy server, based on personal experience. Step-by-Step Process to Create a Subdomain Step 1: Log in to cPanel Access your GoDaddy hosting account and log in to cPanel. Step 2: Navigate to Addon Domains In the cPanel top menu, click Addon Domains. Step 3: Add the Subdomain In the Addon Domains section, enter your subdomain details as shown below. For example, to…