I got some problems with my patterns. Hope somebody could help me with this.
given a string
$string = Mutualism has been retrospectively characterised as ideologically situated between individualist and collectivist forms of anarchism.<ref>Avrich, Paul. ''Anarchist Voices: An Oral History of Anarchism in America'', Princeton University Press 1996 ISBN 0-691-04494-5, p.6<br />''Blackwell Encyclopaedia of Political Thought'', Blackwell Publishing 1991 ISBN 0-631-17944-5, p. 11.</ref> Proudhon first characterised his goal as a "third form of society, the synthesis of communism and property."<ref>Pierre-Joseph Proudhon. ''What Is Property?'' Princeton, MA: Benjamin R. Tucker, 1876. p. 281.</ref> Another is <ref name=rupert/>
I want to remove strings inside the <ref> (<ref name='something'></ref> or <ref></ref>) or remove the single ref tag <ref name='sss' />
after replacing the final out put should be :
Mutualism has been retrospectively characterised as ideologically situated between individualist and collectivist forms of anarchism. Proudhon first characterised his goal as a "third form of society, the synthesis of communism and property." Another is
my code doesn't seem to work
$pattern1[] = "/<ref[^\/]*\/>/is"; //remove <ref name=something/>
$pattern1[] = "/<ref[^\/]*>(.*?)<\/ref>/s"; //remove ref <ref>some text here</ref>
preg_replace($pattern1,"\n", $string);
instead it outputs :
Mutualism has been retrospectively characterised as ideologically situated between individualist and collectivist forms of anarchism. ''Blackwell Encyclopaedia of Political Thought'', Blackwell Publishing 1991 ISBN 0-631-17944-5, p. 11.</ref> Proudhon first characterised his goal as a "third form of society, the synthesis of communism and property." Another is
I guess it got caught up with the <br />
"or'.