Hi! Please refine this line using preg_replace() $query = "id, pic=>img, detail=>a, dt=>h, type, active"; Code (markup): I want to remove "=>img" and "=>a" and "=>h" And the result should be like this: $query = "id, pic, detail, dt, type, active"; Code (markup): Please Guide.
It doesn't make sense why you would do that ? Basically all you have to do is write the new line under the first one... the last line will take presidency.
$query = "id, pic=>img, detail=>a, dt=>h, type, active"; $query = preg_replace("@=>[a-z]*@","",$query); echo $query; PHP:
Thanks for reply friends. Thanks a lot @Technoslab Exactly this i was searching. Could you please tell me that what "@" is doing here? Now i've another query. Please set pattern for this too. $query = "id=>ID, pic=>Picture/img, detail=>Detail/a, dt=>Date/h, type=>Type, active=>Active"; Code (markup): I want 3 patterns. 1) id, pic, detail, dt, type, active 2) ID, Picture, Dtail, Date, Type, Active 3) '', img, a, h, '', '' Please guide like your's previous one.
I just want to left "Picture" in it using preg_replace(); icon=>Picture/img Code (markup): I tried: preg_replace("/[a-zA-Z_]*=>/", "", 'icon=>Picture/img'); Code (markup): It replaced 'icon=>' "/img" will be optional. Please guide.
Hi, I've this query select id=>ID, name=>Name/h, icon=>My Picture/img, link=>Link/a, active=>Action from es_socialmedia where del='no' order by id desc limit 0,20 Code (markup): I just want to remove these: =>ID =>Name/h =>icon=>My Picture/img =>Link/a =>Action I'm using this preg_replace() preg_replace("@=>[a-zA-Z_(\/(.?))]*@", "", $sql); Code (markup): It's working perfect. But! when i'm using space between "My Picture/img" Then i'm getting error. I tried (\s) too, But it's not working :S If i'm using "My_Picture/img" with underscore. It works perfect. Plz could anyone refine this sql query for me? Help will be appreciated.