Yeah, I understand . it is the thumbnail maker for google images page. But if I want to have a specific script for this conversion, one can never be sure. If you notice, there are two colons in the query, which if percent encoded will render the URL invalid.<div>

<br></div><div>Thanks for all your inputs. </div><div><br clear="all">--<br>Regards,<br>Nitin Kumar Gupta<br><a href="http://publicmind.in/blog/">http://publicmind.in/blog/</a><br>
<br><br><div class="gmail_quote">On Sat, Oct 3, 2009 at 3:06 AM, Domenic Santangelo <span dir="ltr">&lt;<a href="mailto:domenic@workhabit.com">domenic@workhabit.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">




  

<div bgcolor="#ffffff" text="#000000"><div class="im">
nitin gupta wrote:
<blockquote type="cite">@URL: Maybe in hurry, I did not explain it properly. This
was exactly what I was doing. look at the project, <a href="https://sourceforge.net/projects/absoluteurl/" target="_blank">https://sourceforge.net/projects/absoluteurl/</a>
  <div><br>
  </div>
  <div>until I came across this image url on the google images page:</div>
  <div><br>
  </div>
  <div><a href="http://t3.gstatic.com/images?q=tbn:7i1D2KAZcCd8yM:http://www.flash-slideshow-maker.com/images/help_clip_image004.jpg" target="_blank">http://t3.gstatic.com/images?q=tbn:7i1D2KAZcCd8yM:http://www.flash-slideshow-maker.com/images/help_clip_image004.jpg</a></div>


  <div><br>
  </div>
  <div>What would you consider here the query string or the path?
Anything we do, the URL is going to break unless we do nothing. Any
ideas?(may be just for encode the spaces).</div>
  <div><br clear="all">
  </div>
</blockquote></div>
scheme: http<br>
host: <a href="http://t3.gstatic.com/images?q=tbn:7i1D2KAZcCd8yM:http://www.flash-slideshow-maker.com/images/help_clip_image004.jpg" target="_blank">t3.gstatic.com</a><br>
path: <a href="http://t3.gstatic.com/images?q=tbn:7i1D2KAZcCd8yM:http://www.flash-slideshow-maker.com/images/help_clip_image004.jpg" target="_blank">images</a><br>
query: <a href="http://t3.gstatic.com/images?q=tbn:7i1D2KAZcCd8yM:http://www.flash-slideshow-maker.com/images/help_clip_image004.jpg" target="_blank">q=tbn:7i1D2KAZcCd8yM:http://www.flash-slideshow-maker.com/images/help_clip_image004.jpg</a><br>


<br>
That url is some sort of thumbnail maker or something... compare to
<a href="http://www.flash-slideshow-maker.com/images/help_clip_image004.jpg" target="_blank">http://www.flash-slideshow-maker.com/images/help_clip_image004.jpg</a><br><font color="#888888">
<br>
-D</font><div><div></div><div class="h5"><br>
<br>
<br>
<blockquote type="cite">
  <div>--<br>
Regards,<br>
Nitin Kumar Gupta<br>
  <a href="http://publicmind.in/blog/" target="_blank">http://publicmind.in/blog/</a><br>
  <br>
  <br>
  <div class="gmail_quote">On Sat, Oct 3, 2009 at 2:22 AM, Domenic
Santangelo <span dir="ltr">&lt;<a href="mailto:domenic@workhabit.com" target="_blank">domenic@workhabit.com</a>&gt;</span>
wrote:<br>
  <blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
    <div bgcolor="#ffffff" text="#000000">
    <div>nitin gupta wrote:
    <blockquote type="cite">Thanks for your help. but this query will
probably select
&quot;abcfooxyz&quot; as well when &quot;foo&quot; is supplied. (untested), although it
will definitely select &quot;foo&quot; in &quot;foo bar&quot; (tested)
      <div><br>
      <div>$xpath-&gt;query(&quot;//div[contains(@class, &#39;&quot; . $class .
&quot;&#39;)]&quot;) <br>
      <br>
      </div>
      <div>How can we be more specific? </div>
      </div>
    </blockquote>
    </div>
Try this example:
    <a href="http://westhoffswelt.de/blog/0036_xpath_to_select_html_by_class.html" target="_blank">http://westhoffswelt.de/blog/0036_xpath_to_select_html_by_class.html</a>
    <div><br>
    <br>
    <blockquote type="cite">
      <div>
      <div>@URL: Actually I am maintaining the module feedapi
imagegrabber,
which downloads images from external websites. Now sometimes the url I
parse has spaces, so I am unable to decide whether or not  to
percentage encode the URL, because percentage encoding will make this
URL valid but will break the following URL:<br>
      <a href="http://www.google.com/search?q=hello" target="_blank">http://www.google.com/search?q=hello</a></div>
      <div>by converting it to </div>
      <div><a href="http://www.google.com/search?q%3Dhello" target="_blank">http://www.google.com/search?q%3Dhello</a></div>
      </div>
    </blockquote>
    </div>
&quot;q=hello&quot; is a query string, not strictly part of the path. I would
strip the url to its component parts (parse_url) and encode the path,
then re-append the query string.<br>
    <br>
    <a href="http://us2.php.net/manual/en/function.parse-url.php" target="_blank">http://us2.php.net/manual/en/function.parse-url.php</a><br>
    <a href="http://www.faqs.org/rfcs/rfc1738.html" target="_blank">http://www.faqs.org/rfcs/rfc1738.html</a><br>
    <br>
HTH,<br>
    <font color="#888888"><br>
-D</font>
    <div><br>
    <br>
    <br>
    <blockquote type="cite">
      <div>
      <div>Looking forward.<br>
      <br>
--<br>
Regards,<br>
Nitin Kumar Gupta<br>
      <a href="http://publicmind.in/blog/" target="_blank">http://publicmind.in/blog/</a><br>
      <br>
      <br>
On Sat, Oct 3, 2009 at 1:30 AM, Domenic Santangelo &lt;<a href="mailto:domenic@workhabit.com" target="_blank">domenic@workhabit.com</a>&gt;
wrote:<br>
&gt;<br>
&gt; nitin gupta wrote:<br>
&gt;<br>
&gt; for eg &lt;div class=&quot;foo&quot;&gt;&lt;/div&gt; is selected by the
following query.<br>
&gt; $class = &quot;foo&quot;;<br>
&gt; $xpath-&gt;query(&quot;//*[@class = &#39;&quot;.$class.&quot;&#39;]&quot;);<br>
&gt; But, this fails in case of multiple classes, i.e. does not select
this :<br>
&gt; &lt;div class=&quot;foo bar&quot;&gt; &lt;/div&gt;<br>
&gt;<br>
&gt; The &quot;contains&quot; function would probably work, eg (untested):<br>
&gt; $xpath-&gt;query(&quot;//div[contains(@class, &#39;&quot; . $class . &quot;&#39;)]&quot;);<br>
&gt;<br>
&gt; One more question: is this url valid : <a href="http://xyz.com/path" target="_blank">http://xyz.com/path</a>
with space.html<br>
&gt;<br>
&gt; Nope. You can escape the url if you just HAVE to have spaces:<br>
&gt;<br>
&gt; <a href="http://n00b.com/path%20with%20space.html" target="_blank">http://n00b.com/path%20with%20space.html</a><br>
&gt;<br>
&gt; but why not use dashes?<br>
&gt;<br>
&gt; <a href="http://pro.com/path-with-properly-indexed-spaces.html" target="_blank">http://pro.com/path-with-properly-indexed-spaces.html</a><br>
&gt;<br>
&gt; -Dom</div>
      </div>
    </blockquote>
    <br>
    </div>
    </div>
  </blockquote>
  </div>
  </div>
</blockquote>
</div></div></div>

</blockquote></div><br></div>