<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Modifying Zend_Db_Adapter_Abstract::quoteInto to accept multiple question marks</title>
	<atom:link href="http://tech.amikelive.com/node-5/modifying-zend_db_adapter_abstractquoteinto-to-accept-multiple-question-marks/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech.amikelive.com/node-5/modifying-zend_db_adapter_abstractquoteinto-to-accept-multiple-question-marks/</link>
	<description>Read . Enjoy . Share</description>
	<lastBuildDate>Wed, 11 Jan 2012 11:54:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Andrew</title>
		<link>http://tech.amikelive.com/node-5/modifying-zend_db_adapter_abstractquoteinto-to-accept-multiple-question-marks/comment-page-1/#comment-7567</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Thu, 16 Apr 2009 07:24:39 +0000</pubDate>
		<guid isPermaLink="false">http://tech.amikelive.com/node-5/modifying-zend_db_adapter_abstractquoteinto-to-accept-multiple-question-marks/#comment-7567</guid>
		<description>@Lee: I use this solution:

public function quoteInto($text, $value)
{
	if ( ! is_array($value) )
		$value = array($value);
	$qmpos = 0; // question mark position
	foreach ( $value as $relacement )
	{
		// get the most left question mark position
		$qmpos = strpos($text, &#039;?&#039;, $qmpos);
		// no question mark left, jump out of the cycle
		if ( $qmpos === false )
			break;
		// replace the question mark with $replacement
		$text = substr_replace($text, 
			$this-&gt;quote($relacement), $qmpos, 1);
	}
	return $text;
}
</description>
		<content:encoded><![CDATA[<p>@Lee: I use this solution:</p>
<p>public function quoteInto($text, $value)<br />
{<br />
	if ( ! is_array($value) )<br />
		$value = array($value);<br />
	$qmpos = 0; // question mark position<br />
	foreach ( $value as $relacement )<br />
	{<br />
		// get the most left question mark position<br />
		$qmpos = strpos($text, &#8216;?&#8217;, $qmpos);<br />
		// no question mark left, jump out of the cycle<br />
		if ( $qmpos === false )<br />
			break;<br />
		// replace the question mark with $replacement<br />
		$text = substr_replace($text,<br />
			$this-&gt;quote($relacement), $qmpos, 1);<br />
	}<br />
	return $text;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: QuoteInto to with multiple parameters - Zend Framework Forum</title>
		<link>http://tech.amikelive.com/node-5/modifying-zend_db_adapter_abstractquoteinto-to-accept-multiple-question-marks/comment-page-1/#comment-1712</link>
		<dc:creator>QuoteInto to with multiple parameters - Zend Framework Forum</dc:creator>
		<pubDate>Mon, 11 Aug 2008 23:44:23 +0000</pubDate>
		<guid isPermaLink="false">http://tech.amikelive.com/node-5/modifying-zend_db_adapter_abstractquoteinto-to-accept-multiple-question-marks/#comment-1712</guid>
		<description>[...] function doesnt support supplying parameters as an array of values. I came across this article:  Modifying Zend_Db_Adapter_Abstract::quoteInto to accept multiple question marks at Amikelive &#124; Techn...  And this guy recommends modifying the function definition. I just want to know if this is the [...]</description>
		<content:encoded><![CDATA[<p>[...] function doesnt support supplying parameters as an array of values. I came across this article:  Modifying Zend_Db_Adapter_Abstract::quoteInto to accept multiple question marks at Amikelive | Techn&#8230;  And this guy recommends modifying the function definition. I just want to know if this is the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lee</title>
		<link>http://tech.amikelive.com/node-5/modifying-zend_db_adapter_abstractquoteinto-to-accept-multiple-question-marks/comment-page-1/#comment-573</link>
		<dc:creator>Lee</dc:creator>
		<pubDate>Thu, 10 Jan 2008 01:59:13 +0000</pubDate>
		<guid isPermaLink="false">http://tech.amikelive.com/node-5/modifying-zend_db_adapter_abstractquoteinto-to-accept-multiple-question-marks/#comment-573</guid>
		<description>Many parts of the Zend Framework seem rather raw and in need of more work and this is certainly one of them. I&#039;d like to see the quoteInto function accept and array as it&#039;s second parameter and replace each ? from left to right with the values of the array. So quoteInto should accept either and array or a string as the second param. Passing in a string would result in the function&#039;s current behavior. Does that make sense to anyone else?</description>
		<content:encoded><![CDATA[<p>Many parts of the Zend Framework seem rather raw and in need of more work and this is certainly one of them. I&#8217;d like to see the quoteInto function accept and array as it&#8217;s second parameter and replace each ? from left to right with the values of the array. So quoteInto should accept either and array or a string as the second param. Passing in a string would result in the function&#8217;s current behavior. Does that make sense to anyone else?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

