Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header('Content-Type: text/html; charset=utf-8');
- $db = mysql_connect('localhost', 'db_name', 'db_pass');
- mysql_select_db('db_name');
- mysql_set_charset('utf8');
- $res = mysql_query("SELECT * FROM product_description WHERE description like '%'");
- while($row = mysql_fetch_array($res)){
- $anchor = strval($row['description']); //Only this string changed!
- $anchor = preg_replace(
- '@\<a\b[^\>]*\>(.*?)\<\/a\b[^\>]*\>@',
- '\1',
- $anchor
- );
- echo $anchor;
- }
- mysql_close($db);
- ?>
- <?php
- header('Content-Type: text/html; charset=utf-8');
- $db = mysql_connect('localhost', 'db_name', 'db_pass');
- mysql_select_db('db_name');
- mysql_set_charset('utf8');
- $res = mysql_query("SELECT * FROM product_description WHERE description like '%'");
- while($row = mysql_fetch_array($res)){
- $anchor = 'Lorem ipsum <a href="http://www.google.es">Google</a> Lorem ipsum <a href="http://www.bing.com">Bing</a>'; //Only this string changed!
- $anchor = preg_replace(
- '@\<a\b[^\>]*\>(.*?)\<\/a\b[^\>]*\>@',
- '\1',
- $anchor
- );
- echo $anchor;
- }
- mysql_close($db);
- ?>
Add Comment
Please, Sign In to add comment