Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php regex markdown link

$text = 'Link to [Google](https://www.google.com/)';
echo preg_replace('/[(.*?)]s*(((?:http://|https://)(?:.+)))/', '<a href="$2">$1</a>', $text);
// Outputs: Link to <a href="https://www.google.com/">Google</a>
Comment

PREVIOUS NEXT
Code Example
Php :: PHP redirect parent page 
Php :: inject multiple logger symfony 
Php :: php+js,code 
Php :: enhanced ecommerce data layer for woocommerce 
Php :: parameterize constructor mpdf php 
Php :: call stored procedure in laravel 
Php :: how to duplicate a database in phpmyadmin 
Php :: $s = [1,2,3] for loop use in php 
Php :: filter elementor 
Php :: shorthand to assign multiple variable to same value in php 
Php :: vault deployment in production 
Php :: how can we send attached file with notification in gmail in laravel 8 
Php :: php version 7.4 
Php :: laravel eager loading pass variable in withCount where condition 
Php :: Best Image Manipulation and Graphs tools for php 
Php :: connecting to database and performing sql queries 
Php :: blocking youtube adds in php 
Php :: PHP quoted_printable_decode — Convert a quoted-printable string to an 8 bit string 
Php :: difference between guard and fillable laravel 
Php :: Convert Array Value Session Value To String PHP 
Php :: php check bracket correct open and close 
Php :: import csv in laravel 8 
Php :: sort names alphabetically php 
Php :: php encrypt decrypt online 
Php :: php inline variables string 
Php :: simple pyramid pattern 
Php :: laravel blade if links exists 
Php :: php array_walk_recursive 
Php :: php substring last 4 characters to censure credit card 
Php :: how to refresh a php variable without reloading page 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =