php-general Digest 6 Nov 2011 15:16:28 -0000 Issue 7555

2011-11-06 Thread php-general-digest-help

php-general Digest 6 Nov 2011 15:16:28 - Issue 7555

Topics (messages 315602 through 315603):

Re: Converting string to array index
315602 by: Bastien
315603 by: Shawn McKenzie

Administrivia:

To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
php-gene...@lists.php.net


--
---BeginMessage---


On 2011-11-05, at 10:21 PM, Ethan Rosenberg eth...@earthlink.net wrote:

 Dear list -
 
 I have an associative array that will return a string representing an array 
 index.  I now need to convert this string into an actual array index.
 
 $test1 = array
 (
 e1 = [4][7],
 e2 = [5][8]
 );
 
 so.. $z = $test1['e1'];
 z has the value of [4][7].  I need to convert this string to an array index 
 so I can use it in $results[4][7].
 
 How do I do it?
 
 Thanks.
 
 Ethan
 
 MySQL 5.1  PHP 5.3.3-6  Linux [Debian squeeze(sid)]  
 
 
 -- 
 

Array_flip()?

http://php.net/manual/en/function.array-flip.php


Bastien
---End Message---
---BeginMessage---
On 11/05/2011 09:21 PM, Ethan Rosenberg wrote:
 Dear list -
 
 I have an associative array that will return a string representing an
 array index.  I now need to convert this string into an actual array index.
 
 $test1 = array
 (
 e1 = [4][7],
 e2 = [5][8]
 );
 
 so.. $z = $test1['e1'];
 z has the value of [4][7].  I need to convert this string to an array
 index so I can use it in $results[4][7].
 
 How do I do it?
 
 Thanks.
 
 Ethan
 
 MySQL 5.1  PHP 5.3.3-6  Linux [Debian squeeze(sid)] 
 

Not sure I totally understand, but from my assumption:

foreach($test1 as $k = $v) {
   eval(\$results$v = $k;);
}
print_r($results);

-- 
Thanks!
-Shawn
http://www.spidean.com
---End Message---


[PHP] Re: Converting string to array index

2011-11-06 Thread Shawn McKenzie
On 11/05/2011 09:21 PM, Ethan Rosenberg wrote:
 Dear list -
 
 I have an associative array that will return a string representing an
 array index.  I now need to convert this string into an actual array index.
 
 $test1 = array
 (
 e1 = [4][7],
 e2 = [5][8]
 );
 
 so.. $z = $test1['e1'];
 z has the value of [4][7].  I need to convert this string to an array
 index so I can use it in $results[4][7].
 
 How do I do it?
 
 Thanks.
 
 Ethan
 
 MySQL 5.1  PHP 5.3.3-6  Linux [Debian squeeze(sid)] 
 

Not sure I totally understand, but from my assumption:

foreach($test1 as $k = $v) {
   eval(\$results$v = $k;);
}
print_r($results);

-- 
Thanks!
-Shawn
http://www.spidean.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php sqlite

2011-11-06 Thread tamouse mailing lists
On Sat, Nov 5, 2011 at 3:33 AM, saeed ahmed mycomputerbo...@gmail.com wrote:
 i want to start with php sqlite.which  light weight versions should i
 download?i have win xp sp3.


I though sqlite came bundled...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Google Search Appliance and PHP

2011-11-06 Thread tamouse mailing lists
On Thu, Nov 3, 2011 at 10:11 AM, Gates, Jeff gat...@si.edu wrote:
 I am a newbie in PHP.

 I need to create a search using Google's Search Appliance for a site I'm 
 designing but don't have the slightest idea on how to do it. Because I want 
 to incorporate the site's design into the search results page I can't use the 
 GSA's simple page layout wizard.

 Here's what I need to be able to learn how to do:


  1.  Create a search form and send it to our GSA (this is pretty easy).
  2.  Create a processing page to parse the XML

Take at look at SimpleXML:
http://us.php.net/manual/en/book.simplexml.php -- it may be as far as
you need to go with XML.

  3.  Create a results page using the header and footer of my site.

PHP was born a templating language. This is simplicity in itself: just
include them where you want them to display:

   include(HEADER.html);

blah blah page content blah blah

   include(FOOTER.html);



 Can anyone help me with simple explanation on how to do steps 2 and 3?

 Thanks,

 Jeff

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php