php-general Digest 30 Jul 2009 08:06:56 - Issue 6257
Topics (messages 296015 through 296049):
Re: Getting rid of extra lines
296015 by: Ashley Sheridan
296016 by: Bob McConnell
296020 by: Jim Lucas
296021 by: Miller, Terion
296022 by: Miller, Terion
php-general Digest 30 Jul 2009 21:25:35 - Issue 6258
Topics (messages 296050 through 296075):
stdClass - A newbie question
296050 by: MEM
296051 by: Bouz Alexander
296053 by: MEM
296066 by: Shawn McKenzie
Word and UTF-8 (cyrillic, chinese, ...)
On Wednesday 29 July 2009 10:18:08 pm Skip Evans wrote:
Hey,
I've been asked to write a simple couple of public pages that
would let an Asterisk customer modify their account
configuration, but the client has no idea how Asterisk stores
its data, apparently not in MySQL.
Anyone know of any
Hello everybody,
In this class sketch:
?php
class Pagination {
...
public static function Pagination ($total_records, $limit, $page)
{
$total_pages = ceil($total_records / $limit);
$page = max($page, 1);
$page = min($page,
Hello Márcio,
stdClass is simply an empty class, without any properties or methods.
The object in the code sample is used to return multiple values at once. He
could also have used an associative array to achieve that, but by choosing an
object, he shows his affinity to the object oriented
Hi there,
I am currently struggling in forcing Word to show a UTF-8 encoded document. The
generated document is a normal web page with generated content from a mysql
database.
When I remove the header commands, the document with proper russian characters
is displayed fine in the browser, but
By the way, there are many reasons for creating objects inside of other
objects. This should not be considered an exception. I don't know where
this code belongs to, so I can't clear out if it is good or bad OOP
style.
I do not intend to public judge the author, but the original article is
/usr/share/file/magic
/usr/share/file/magic has lots of rules to know its type and its just
matching it.
I know it has a lot of rules. Grepping it for excel shows that there
are rules in it for those types of files as well.
Maybe your file is quite strange . have you tried with other xls
How would you go about ensuring the memory is not exhausted when running a
script ?
I have a script, which to make it basic ... reads values from files, I
create an array of values per file then with a foreach insert values into a
table, I have added a line to echo the memory use after each
Christoph Boget wrote:
/usr/share/file/magic
/usr/share/file/magic has lots of rules to know its type and its just
matching it.
I know it has a lot of rules. Grepping it for excel shows that there
are rules in it for those types of files as well.
Maybe your file is quite strange . have
On 07/30/2009 08:53 AM, Peter Ford wrote:
Have you tried using 'file -i' from the command line: after all you are looking
for a MIME type with your fileinfo...
Having said that, with file -i on my system, Word documents are
'application/msword' and Excel files are 'application/octet-stream'
Have you tried using 'file -i' from the command line: after all you are
looking
for a MIME type with your fileinfo...
Having said that, with file -i on my system, Word documents are
'application/msword' and Excel files are 'application/octet-stream'
$ file -i excel.xls
excel.xls:
Having said that, with file -i on my system, Word documents are
'application/msword' and Excel files are 'application/octet-stream'
Fedora11 (2.6.29.6-213.fc11.i586)
$ file excel.xls
excel.xls: CDF V2 Document, Little Endian, Os: Windows, Version 5.1, Code
page: 1252, Author:
On Thu, 2009-07-30 at 09:51 -0400, Christoph Boget wrote:
Having said that, with file -i on my system, Word documents are
'application/msword' and Excel files are 'application/octet-stream'
Fedora11 (2.6.29.6-213.fc11.i586)
$ file excel.xls
excel.xls: CDF V2 Document, Little Endian, Os:
The xls file I am using was generated with Excel (of Office 2007) for
the Mac. So either you have a different magic file (assuming that's
what the file command uses) than I do or different versions of excel
contain different information.
I just tried using an excel spreadsheet saved using
From: Christoph Boget
Have you tried using 'file -i' from the command line: after all you
are looking
for a MIME type with your fileinfo...
Having said that, with file -i on my system, Word documents are
'application/msword' and Excel files are 'application/octet-stream'
$ file -i
On Thu, 2009-07-30 at 07:12 -0700, Christoph Boget wrote:
Well, I didn't want to upload a file to the list. Putting it in a
central location where those interested parties could access it would
be a much better option.
thnx,
Chris
Skip Evans wrote:
Per Jessen wrote:
Depends on which data we're talking about. Asterisk is very
flexible.
For example, the first screen they want people to be able to
change data on is:
call waiting,do not disturb
and then it looks like numbers (forwarding?)
How would you go about ensuring the memory is not exhausted when running a
script ?
I have a script, which to make it basic ... reads values from files, I
create an array of values per file then with a foreach insert values into a
table, I have added a line to echo the memory use after
MEM wrote:
By the way, there are many reasons for creating objects inside of other
objects. This should not be considered an exception. I don't know where
this code belongs to, so I can't clear out if it is good or bad OOP
style.
I do not intend to public judge the author, but the original
echo (preg_match($pattern, $test) != false)
The != false here is redundant.
Understood. But what you think is redundancy is, to me, clarity in
programming. I happen to think that boolean tests shouldn't ride on
whether or not an array returned from a function is empty or not (or a
Ben Dunlap wrote:
have -- ($x != false) -- will be true whether $x is 0, NULL, an empty
string,
[8]
But $x !== false will only be true in the last case.
Sorry, replace be true with be false above.
-Ben
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Hi there,
I am trying to filter out content that is not ascii. Can I do this with
regex? For example:
$regex = '[AZ][09]';
if (preg_match($regex, $text)) {
return TRUE;
}
else {
return FALSE;
}
The reason I need to do
http://72.47.28.125:8080/phpinfo.php not working
ERROR:
The website cannot display the page
HTTP 500
IIS 5.1, PHP 5.3 XP Prof SP3 + all updates
PHP 5.2.8 worked great and took a few minutes to install
phpinfo.php is in C:\inetpub\wwwroot
?php
phpinfo();
?
php.ini has:
doc_root =
Hi Merlin,
I think the pattern you're looking for is '/[a-zA-Z0-9]/' which will
match all alphanumeric characters.
Cheers
Stuart
On 30 Jul 2009, at 19:13, Merlin Morgenstern wrote:
Hi there,
I am trying to filter out content that is not ascii. Can I do this
with regex? For example:
I Figured it out using this:
if ($_SERVER['SCRIPT_FILENAME'] = browse.php ) {
$default = A;
}
Miller, Terion wrote:
I Figured it out using this:
if ($_SERVER['SCRIPT_FILENAME'] = browse.php ) {
$default = A;
}
Jim Lucas wrote:
Miller, Terion wrote:
I Figured it out using this:
if ($_SERVER['SCRIPT_FILENAME'] = browse.php ) {
$default = A;
} else {
$default = ;
}
$letter = isset($_GET['letter'])? $_GET['letter'] :$default ;
unless you are doing more then what you are showing above.
Merlin Morgenstern wrote:
Hi there,
I am trying to filter out content that is not ascii. Can I do this with
regex? For example:
$regex = '[AZ][09]';
if (preg_match($regex, $text)) {
return TRUE;
}
else {
return FALSE;
}
The reason I need to do
Merlin Morgenstern wrote:
Hi there,
I am trying to filter out content that is not ascii. Can I do this with
regex? For example:
$regex = '[AZ][09]';
if (preg_match($regex, $text)) {
return TRUE;
}
else {
return FALSE;
}
The reason I need to do
I'm looking at this page now that shows working with the
database through socket type stuff, but now the ball is in the
client's court what they want to do. Not sure, so I'm just
reading up.
http://www.voip-info.org/tiki-index.php?page=Web+based+Asterisk+Database+maintenance
But thanks all
Hey all,
Am I brain fading or what? I'm so used to formatting text in
tables for HTML display I can't think of how to do it for a
plain text file.
I just need to create a columned table of names and addresses
type stuff... sprintf?
--
Skip Evans
Big Sky
Skip Evans wrote:
Hey all,
Am I brain fading or what? I'm so used to formatting text in tables for
HTML display I can't think of how to do it for a plain text file.
I just need to create a columned table of names and addresses type
stuff... sprintf?
or a little str_pad on each
Jim Lucas wrote:
Skip Evans wrote:
Hey all,
Am I brain fading or what? I'm so used to formatting text in tables for
HTML display I can't think of how to do it for a plain text file.
I just need to create a columned table of names and addresses type
stuff... sprintf?
or a little str_pad on
Skip Evans wrote:
Jim Lucas wrote:
Skip Evans wrote:
Hey all,
Am I brain fading or what? I'm so used to formatting text in tables for
HTML display I can't think of how to do it for a plain text file.
I just need to create a columned table of names and addresses type
stuff... sprintf?
or a
I'm cleaning up some inherited code in our data import module. For a
variety of reasons we have to support old standards of the import
format. Since some of those old versions were created we have since
renamed some fields in our data structure. So right now I've a hard
map for some field names...
Hi,
Well, you will have an infinite recursion there if the mapping has
cycles, something like A-B, B-C, C-A would generate an invite
recursion.
Checking if the mapping has cycles is pretty simple: you have to
create a directed graph and then go through the graph in DFS marking
each visited node,
I don't THINK I need to worry about circular mappings... but I'm not
sure how to check for it if I did...
Any suggestions? Thanks!
Would the following work? It avoids recursion entirely and also checks for
circular mappings. You can plug in your own code where the comments are to do
whatever
On Wed, Jul 29, 2009 at 1:18 PM, Skip Evans s...@bigskypenguin.com wrote:
Hey,
I've been asked to write a simple couple of public pages that would let an
Asterisk customer modify their account configuration, but the client has no
idea how Asterisk stores its data, apparently not in MySQL.
while (isset($FieldMap[$Field]) {
Oops, left out the final close-parenthesis. I always do that with isset() for
some reason.
Ben
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Is there a more efficient way to write the following?
?php $result = mysql_query(SELECT priceList FROM catalog WHERE
itemid='ABC1',$db);
printf(iList: s%s/s/ibr /\n, money_format('$%i',
mysql_result($result,0,priceList))); ?
I have many products per page and this code pulls the
On 07/30/2009 06:29 PM, Skip Evans wrote:
Jim Lucas wrote:
Skip Evans wrote:
Hey all,
Am I brain fading or what? I'm so used to formatting text in tables for
HTML display I can't think of how to do it for a plain text file.
I just need to create a columned table of names and addresses type
?php
//assuming you have a 2d matrix $table
$table = array(
array(c11, c12, c13),
array(c21, c22, c23)
);
foreach($table as $rows) {
$row = vsprintf(str_repeat(%-10s, count($rows)), $rows);
echo {$row}br /\n;
}
wont this do ?
--
PHP General Mailing List (http://www.php.net/)
To
On 07/30/2009 10:15 AM, Ashley Sheridan wrote:
On Thu, 2009-07-30 at 07:12 -0700, Christoph Boget wrote:
You could email it to me, which I presume is better if you replied
back just to me and not the list?
Just copying the list back on in this one now. I don't know of any
places that you
Hi all
I have start a shell script and I want to use ncurses.
It was a quite difficulty to get it working, but now I'm done to start
to develop.
I have already search on sf.net and phpclasses and found a couple, but
I'm looking more stable or with a better OO design.
Do you know any set of
45 matches
Mail list logo