Location: PHPKode > projects > FeedMeLinks, Social BookmarkingSince2002 > feedmelinks.com/testing/quoting.php
<h1> quote replacing test </h1>
<%
	$name1 = 'foo double " bar';
	$name2 = 'foo double %22 bar';
	$name3 = 'foo %22%22dou"ble %22 bar';
	
	$name4 = "foo single ' bar";
	$name5 = 'foo single %27 bar';
	$name6 = "more singles: %27%27'sdlfkhj %27 ''ba'r";
%>

	1: <%= preg_replace( '/("|%22)/', '&quot;', $name1 ) %><br />
	2: <%= preg_replace( '/("|%22)/', '&quot;', $name2 ) %><br />
	3: <%= preg_replace( '/("|%22)/', '&quot;', $name3 ) %><br />
	
	4: <%= preg_replace( '/("|%22)/', '&apos;', $name1 ) %><br />
	5: <%= preg_replace( '/("|%22)/', '&apos;', $name2 ) %><br />
	6: <%= preg_replace( '/("|%22)/', '&apos;', $name3 ) %><br />
Return current item: FeedMeLinks, Social BookmarkingSince2002