RSS
 

Archive for the ‘Uncategorized’ Category

how to remove link from certain string?

16 Jun

Some day, I worked on small piece of programming to tweak Virtuemart feature. The task is to remove link in product title of the product detail. as we know, array variable of product in the flypage.tpl.php or flypage.pbv.tpl.php is not containing ‘pure’ data. it contain some html tag that embedded in the previous process.

To follow good work and to keep virtuemart engine in the original state, I have to modify only on the template. so to remove link from $product['product_title'], I use this code:

echo preg_replace(“/\<a([^>]*)\>([^<]*)\<\/a\>/i”, “$2″, $product['product_title']);

Keep in mind that we can replace link from string using this code:

preg_replace("/\<a(.*)\>(.*)\<\/a\>/iU", "$2", $string);

or:

preg_replace("/\<a([^>]*)\>([^<]*)\<\/a\>/i", "$2", $string);
preg_replace("/\<a(.*)\>(.*)\<\/a\>/iU", "$2", $string);
 
 

Focus to my projects

17 May

Dear my friends,

Now I am using this website to log my programming activity. I will write my experience, my question, my code, my idea, my note, my successful test, etc. it’s about my personal note to be used in the future.

I am using Wordpress now to keep me simple write my notes and avoid effort on modifying website code. I am now too busy to code my site because there’s too many projects to do. I want to focus on my projects and enjoy my programming.

I love and enjoy my programming activity. I enjoy work from home.