Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php get first two paragraphs

$str = "<p>This is one</p><p>This is two</p><p>This is three</p>";
$pattern="/(<p[^>]*>(.*)</p>){2}/isU";
preg_match($pattern,$str,$matches);
echo htmlentities($matches[0]);
Comment

PREVIOUS NEXT
Code Example
Php :: laravel error messages 
Php :: customize laravel pagination links 
Php :: how to get the previous page url in php 
Php :: woocommerce my account php code wordpress 
Php :: compact laravel 
Php :: php method type hinting 
Php :: php concatenation with a space 
Php :: the requested url was not found on this server. apache/2.4.46 (win64) openssl/1.1.1h php/8.0.1 server at localhost port 80 
Php :: laravel simple pagination 
Php :: php explode sentence into words 
Php :: laravel_login 
Php :: php number multiple of 
Php :: command to create middleware in laravel 
Php :: how to set logo in wordpress 
Php :: get array value in php 
Php :: ErrorException symlink(): No such file or directory 
Php :: php create html code 
Php :: add floater to open a modal in wordpress 
Php :: php glob sort by unsigned int 
Php :: php foreach json object 
Php :: spatie laravel pdf image 
Php :: Skip model accessor laravel8 
Php :: PHP Parses a time string according to a specified format 
Php :: unnamed place placeholders pdo 
Php :: wp_query start from second post 
Php :: laravel find model inside the same model 
Php :: wordpress raw query 
Php :: php ini_set 
Php :: Laravel htaccess for aws ec2 
Php :: php get file from another server 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =