Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

How to replace Quotation Marks of InfoType from String/Text?

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

How to replace Quotation Marks of InfoType from String/Text?

Postby Momar » Mon Jun 24, 2013 8:23 am

How can I remove the Quotation Mark value of InfoType from Text/String. Like avatar_head="value"

I want all avatar_head="any_value" to change to avatar_head=""

like for example this Text:
<ITEM id="540001" name="Ceremonial Dress (a.Men)" type="avatar" slot="avatar" avatar_head="eq_head_12"
avatar_chest="eq_chest_16" avatar_hand="eq_hands_17" avatar_legs="eq_legs_16" avatar_feet="eq_feet_16"
totalpoint="0" hp="14" ap="52" weight="33" maxwt="0"
res_sex="m" res_level="2" bt_price="500000" iscashitem="true" desc="Ceremonial Dress that the general ranks of the Empire wear at important ceremonies." />
<ITEM id="540501" name="Ceremonial Dress (a.Women)" type="avatar" slot="avatar" avatar_head="eq_head_05"
avatar_chest="eq_chest_long002" avatar_hand="eq_hands_leather001" avatar_legs="eq_legs_014" avatar_feet="eq_feets_014"
totalpoint="0" hp="14" ap="52" weight="33" maxwt="0"
res_sex="f" res_level="2" bt_price="500000" iscashitem="true" desc="Ceremonial Dress that the general ranks of the Empire wear at important ceremonies." />

<ITEM id="540002" name="Adventurer (a.Men)" type="avatar" slot="avatar" avatar_head="eq_head_16"
avatar_chest="eq_chest_10" avatar_hand="eq_hands_09" avatar_legs="eq_legs_07" avatar_feet="eq_feet_08"
totalpoint="0" hp="5" ap="39" weight="24" maxwt="0"
res_sex="m" res_level="0" bt_price="500000" iscashitem="true" desc="Recommended for novice adventurers who hate outfits with heavy equipment." />
<ITEM id="540502" name="Adventurer (a.Women)" type="avatar" slot="avatar" avatar_head="eq_head_13"
avatar_chest="eq_chest_14" avatar_hand="eq_hands_05" avatar_legs="eq_legs_006" avatar_feet="eq_feets_006"
totalpoint="0" hp="5" ap="39" weight="24" maxwt="0"
res_sex="f" res_level="0" bt_price="500000" iscashitem="true" desc="Recommended for novice adventurers who hate outfits with heavy equipment." />


Please help, thank advance.
I am sorry if I ask here because I can't find a solution in Mr. Google.
Momar
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Jun 24, 2013 8:14 am

Re: How to replace Quotation Marks of InfoType from String/T

Postby johnj » Tue Jun 25, 2013 3:09 am

One way will be to use regular expression
http://phillipnb.wordpress.com/2011/03/ ... ns-part-1/

Another way - use strpos() and find the start/end position of the text that you want to replace and then do a substr_replace()
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot], kiranindia1986, Majestic-12 [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.