to convert the date-time layout Hypertext Preprocessor presents strtotime() and date() feature. We trade the date format from one layout to another. built-IN integrated – we’ve saved date integrated MM-DD-YYYY format integrated a variable, and we need to change it to DD-MM-YYYY format. we will gabuiltintegrated this conversion built-in built-in the use of strtotime() and date() function. The strtotime() first converts the date integratedto the seconds, and then date() function is used to reconstruct the date integrated any layout. beneath a few examples are given to transform the date layout. change YYYY-MM-DD to DD-MM-YYYY integrated beneath built integrated, we’ve date 2019-09-15 built-in YYYY-MM-DD format, and we are able to convert this to 15-09-2019 integrated DD-MM-YYYY layout.
Output New date layout is: 15-09-2019 (DD-MM-YYYY) change YYYY-MM-DD to MM-DD-YYYY built-in the under example, we’ve date 2019-02-26 built-in YYYY-MM-DD layout, and we are able to convert this to 02-26-2019 (MM-DD-YYYY) format.
Output New date format is: 02-26-2019 (MM-DD-YYYY) alternate DD-MM-YYYY to YYYY-MM-DD built-inside the integrated below built-in, we’ve got date 17-07-2012 integrated DD-MM-YYYY layout, and we will convert this to 2012-07-17 (YYYY-MM-DD) format.
Output New date format is: 2012-07-17 (YYYY-MM-DD)
convert date time into D-M-Y Format
$date=date_create($created_on ); $bdate=date_format($date,”dS M, Y”);
in above example $created_on store your date time value and covert them into D-M-Y format
you can adjust number of character i mean if you need to show only 20 character then need to change 50 to 20
Here are two method which one you understand just use them in your code
<?php
$in=”Pellentesque habitant morbi tristique senectus eter netus et malesuada fames ac turpis egestas. Morbi purus nisl, blandit et eros id, pharetra tristique massa. Nulla facilisi. Curabitur lobortis urna eu neque congue, id cursus purus placerat. In malesuada est tellus. Nunc ac ullamcorper nibh. Maecenas lacus dolor, volutpat sed augue sit amet, maximus condimentum sem. Aenean nec egestas orci. Sed fringilla augue eget arcu consectetur interdum. Praesent sed dignissim risus. Ut lobortis dolor nec sagittis dapibus. Donec eget dolor vitae elit porta commodo in et magna. Nunc sapien nisl, euismod ac ex vitae, sodales feugiat lorem. Phasellus condimentum, nulla cursus porta mollis, nulla urna dapibus velit, vitae sagittis arcu risus vitae orci. Praesent leo nisi, laoreet id mauris nec, hendrerit feugiat lacus. Praesent vulputate lorem vel lobortis aliquam.”;
You can use the jQuery :checked selector together with the each() method to retrieve the values of all checkboxes selected during a group. The each() method used here simply iterates over all the checkboxes that are checked. Let’s try an example to check how it works:
Utilizing URLs on your site that are program friendly is straight forward and straight forward to try to to because of PHP and Apache. we’ll be utilizing permalinks that get obviate all the nasty $_GET data that trails the top of most PHP scripts. An example of a SEO unfriendly URL we’ll clean is:
Using a combination of Apache’s ForceType directive, the PHP explode() function and PHP’s PATH_INFO variable we will easily turn the sample URL into:
http://www.domain.com/post/123/seo-php-url
This not only helps our website’s SEO (search engine optimization), but also accomplishes a security concept is understood as “security by obscurity”. By obscuring the very fact that our internet site is employing a PHP script, we may detract potential hackers from trying to find exploits within our scripts.
Follow below code for
Step1: First remove all special character from url
function clean($title) {
$string = str_replace(' ', '-', $title); // Replaces all spaces with hyphens.
$string = preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
return preg_replace('/-+/', '-', $string); // Replaces multiple hyphens with single one.
}
$slug=strtolower(clean($title));
Explanation Of above code
in $title you store form title value and remove space from both end and Convert the predefined characters “<” (less than) and “>” (greater than) to HTML entities
and most important to use clean function .
In this function you just need to pass title value and use this function value in $slug ou your desire url valriable
I am an experienced PHP web developer and completed several web development projects successfully using WordPress , Woocommerce, Html5, CSS3, Bootstrap, JavaScript, JQuery, PHP, Codeigniter, and Mysqli.