php-general Digest 4 Jun 2006 04:15:43 -0000 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
----------------------------------------------------------------------
--- Begin Message ---
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 ---
--- Begin Message ---
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 ---
--- Begin Message ---
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 ---
--- Begin Message ---
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 ---
--- Begin Message ---
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 ---
--- Begin Message ---
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 ---
--- Begin Message ---
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 PECL modules for PHP" from the
Windows binaries section of php.net/downloads.php.
This is mentioned in php.net/java.
Rabin
--
*~:~*~:~*~:~*~:~*~:~*~:~*~:~*~:~*~:~*~:~*
Vedanta Barooah
--- End Message ---