php-general Digest 3 Jun 2006 14:23:06 -0000 Issue 4164
php-general Digest 3 Jun 2006 14:23:06 - Issue 4164 Topics (messages 237310 through 237326): Re: SPL Iterator and Associative Array 237310 by: Greg Beaver 237313 by: Jason Karns Parse error: syntax error, unexpected '}' 237311 by: Mark Sargent 237312 by: Rick Emery 237314 by: Bagus Nugroho 237316 by: Mark Sargent Re: php java intregration 237315 by: Vedanta Barooah 237319 by: Vedanta Barooah 237324 by: Rabin Vincent Recall: [PHP] Parse error: syntax error, unexpected '}' 237317 by: Bagus Nugroho HTTP HEADERS 237318 by: kartikay malhotra 237320 by: David Tulloh 237321 by: Joe Wollard Re: OO purism sucks - this is a rant for anyone who is allergic to thatkind of thing... 237322 by: Jochem Maas $B$$d$G$9!#(B 237323 by: CgjOvY} New release of phpEditIni Ver 1.0 Beta4 is now available 237325 by: Jeremy O'Connor Re: Retrieving Content 237326 by: chris smith Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: php-general@lists.php.net -- ---BeginMessage--- Jason Karns wrote: I'm going to try my best to explain what I'm trying to do. I have my own class that has an array member. This class itself implements Iterator. One of the fields in the array is itself an array that I would like to iterate over. Here's some code: class Folio implements Iterator { $projects = array( array( 'title'=, 'clip'=, 'small'=array('1','2','3')), array( 'title'=, 'clip'=, 'small'=array('0','1','2')) ); function title($x){ return current($this-projects[$]['small']); ^^ } function smalls($x){ return $this-projects[$x]['small']; } } snip Hi Jason, The code you pasted is littered with fatal errors and bugs (I marked one example with ^^ above). Please paste a real batch of code that you've tested and reproduces the error and that will be much more helpful. The PHP version would be helpful to know as well. Greg ---End Message--- ---BeginMessage--- -Original Message- From: Greg Beaver [mailto:[EMAIL PROTECTED] Sent: Friday, June 02, 2006 10:39 PM To: Jason Karns Cc: php-general@lists.php.net Subject: Re: SPL Iterator and Associative Array Jason Karns wrote: I'm going to try my best to explain what I'm trying to do. I have my own class that has an array member. This class itself implements Iterator. One of the fields in the array is itself an array that I would like to iterate over. Here's some code: snip snip Hi Jason, The code you pasted is littered with fatal errors and bugs (I marked one example with ^^ above). Please paste a real batch of code that you've tested and reproduces the error and that will be much more helpful. The PHP version would be helpful to know as well. Greg -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.8.1/354 - Release Date: 6/1/2006 ?php class Folio implements Iterator { private $projects = array(); private $valid = FALSE; public function __construct($file = null) { if(!is_null($file)) $this-load($file); } public function load($file){ ... $keys = array(); $values = array(); foreach ($projects as $project) { $small = array(); $big = array(); foreach ($xpath-query('showcase/images/screenshot/thumbnail',$project) as $img){ $small[] = $img-nodeValue;} foreach ($xpath-query('showcase/images/screenshot/src',$project) as $img){ $big[] = $img-nodeValue;} $keys[] = $xpath-query('@id',$project)-item(0)-nodeValue; $values[] = array( 'title'=$xpath-query('showcase/title',$project)-item(0)-nodeValue, 'href'=$xpath-query('livesite',$project)-item(0)-nodeValue, 'clip'=$xpath-query('showcase/images/feature/thumbnail',$project)-item(0) -nodeValue, 'big'=$big, 'small'=$small, 'text'=$xpath-query('showcase/description',$project)-item(0)-nodeValue); } $this-projects = array_combine($keys,$values); } function smalls($x=null){ if(is_null($x) or !key_exists($x,$this-projects)) $x = $this-key();
php-general Digest 4 Jun 2006 04:15:43 -0000 Issue 4165
php-general Digest 4 Jun 2006 04:15:43 - Issue 4165 Topics (messages 237327 through 237333): ASCII Chars Only 237327 by: Richard Collyer 237328 by: Rabin Vincent 237329 by: Richard Collyer .htaccess - change index.php to index.abc 237330 by: Labunski 237332 by: Joe Wollard Delete 237331 by: George Babichev Re: php java intregration 237333 by: Vedanta Barooah Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: php-general@lists.php.net -- ---BeginMessage--- Hello, Trying to get the following working. I am trynig to select only ASCII characters (not extended ASCII) so that if the string contains characters outside the 32 - 126 range of good characters then $Discard is returned as 0. But it is going overboard telling me that every character is bad :( Ideas? Cheers Richard $test = 飯島真ç�†as; function non_ascii($str) { $Discard = 0; for ($i=0; $i strlen($str); $i++) { $char = ord($test{$i}); if (($char 32 || $char 126)) { $Discard++; } } return $Discard; } print non_ascii($test); ---End Message--- ---BeginMessage--- On 6/3/06, Richard Collyer [EMAIL PROTECTED] wrote: Hello, Trying to get the following working. I am trynig to select only ASCII characters (not extended ASCII) so that if the string contains characters outside the 32 - 126 range of good characters then $Discard is returned as 0. But it is going overboard telling me that every character is bad :( Ideas? Cheers Richard $test = 飯島真ç†as; function non_ascii($str) { $Discard = 0; for ($i=0; $i strlen($str); $i++) { $char = ord($test{$i}); That should be $str, not $test. Rabin ---End Message--- ---BeginMessage--- Rabin Vincent wrote: On 6/3/06, Richard Collyer [EMAIL PROTECTED] wrote: Hello, Trying to get the following working. I am trynig to select only ASCII characters (not extended ASCII) so that if the string contains characters outside the 32 - 126 range of good characters then $Discard is returned as 0. But it is going overboard telling me that every character is bad :( Ideas? Cheers Richard $test = 飯島真ç†as; function non_ascii($str) { $Discard = 0; for ($i=0; $i strlen($str); $i++) { $char = ord($test{$i}); That should be $str, not $test. Rabin Doh! I am indeed a spanner. Thanks. Cheers Richard ---End Message--- ---BeginMessage--- Hello, What should I change in .htaccess, so that visitors will see index.abc instead of index.php. I just wanna hide file's extension. Thanks ---End Message--- ---BeginMessage--- If you don't want to change the names of the files themselve from .php to .abc then you'd need to use something like mod_rewrite for apache's HTTPD. I'm not entirely certain as to how you'd do this, but I've included what I normally use to hide index.php in the url. If possible I'd put this in httpd.conf instead of .htaccess - there are performance concerns that may be involved there. Anyway, I hope this gets you started or sparks an idea from another list member. Directory /var/www/html/ RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] /Directory On 6/3/06, Labunski [EMAIL PROTECTED] wrote: Hello, What should I change in .htaccess, so that visitors will see index.abc instead of index.php. I just wanna hide file's extension. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- Hello everyone! I wrote a blog application, but now for the admin panel, i am trying to add a feature to delete blog posts. It would show the title of the post next to it, and have a delete link which would delete it. How would I do this? I mean if I have multiple blog entry's, how would I delete them without using php my admin? ---End Message--- ---BeginMessage--- the pecl snapshots have the dll php_java.dll, but does not have the jar php_java.jar which is also required? - vedanta On 6/3/06, Rabin Vincent [EMAIL PROTECTED] wrote: On 6/2/06, Vedanta Barooah [EMAIL PROTECTED] wrote: i am setting up php_java.dll extension under windows/iis, my php version is 5.1.2. can any one point me to the download location of php_java.jar which is needed for the setup. Download Collection of