Russell P Jones wrote:
Any idea how to sort an array by string length?
Use usort() in conjunction with a user defined function that compares the
length of
both strings using strlen(). If brevity at the (possible) expense of clarity is
your thing, you can even use create_function() as your
On Wednesday 22 December 2004 04:51, Jason Barnett wrote:
So, seriously, if you don't feel like helping or you don't believe that
a message should be posted here because it's off topic or you don't
believe that a question was phrased properly, wouldn't it be better for
everyone if you just
Hi,
Wednesday, December 22, 2004, 7:18:52 AM, you wrote:
RPJ Any idea how to sort an array by string length?
RPJ Russ Jones
With a user defined sorting function something like this
?php
function cmp($a, $b){
$x = strlen($a);
$y = strlen($b);
if ($x == $y) {
return 0;
}
return
On Wednesday 22 December 2004 05:35, Matthew Sims wrote:
You know, I bet that man is getting sick of eating fish all the time.
You don't have to fish for fish, you can fish for old boots if you want a
change in diet :-)
Teach a man to shoot a cow...
What and get mad cows disease?
--
Jason
On Wednesday 22 December 2004 05:08, Jason Barnett wrote:
Jerry Swanson wrote:
So I want to keep PHP register_globals=on in php.ini, but in local
files set to off?
How I can do this?
You can change this, and other php.ini directives, with the PHP function
ini_set
No you can't. Well
[quote]
On Wednesday 22 December 2004 01:37, Paul Aviles wrote:
Guys, this is trivial. It takes the same effort to provide the
answer
to whoever this guy was, than to lecture him on how to think.
Teach a person to fish ...
--
Jason Wong - Gremlins Associates - www.gremlins.biz
You know,
On Wednesday 22 December 2004 03:53, Richard Lynch wrote:
? can be caught by PHP as the end of PHP mode, no matter where you put it
in a string or not.
You can't be serious? Or have I misunderstood you?
?php echo '?php ?'; ?
Works as expected, ie displays ?php ?.
--
Jason Wong - Gremlins
now guys/ladies.. this was funny!
and can we move on... !
-Original Message-
From: Matthew Sims [EMAIL PROTECTED]
Sent: Dec 21, 2004 1:35 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] can I compile php source
On Wednesday 22 December 2004 01:37, Paul Aviles wrote:
Guys, this is
On Wednesday 22 December 2004 05:18, Russell P Jones wrote:
Any idea how to sort an array by string length?
usort(), strlen()
--
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design Hosting * Internet Intranet Applications Development *
One of the Array sort functions?
http://www.php.net/usort
Russell P Jones wrote:
Any idea how to sort an array by string length?
Russ Jones
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hello all,
Please see the simple php program below. It recieves input from an html
file form that outputs a clients first name and then last name.
My problem is this, I cannot figure out how to get a 'space' to print out
between the first and last name
Any advise or thoughts for this php
Below is a simple php file that recieves input from a form html file. The
php file outputs the first and last name, but their is no space between the
names. Does anyone know how I can get a space between name in the php file?
TIA,
Gary
html
head
titleHi User/title
/head
body
h3PHP program that
You will notice
that the previous line also contains a '?' sequence, so I'm confused
as to why this would die on one line but not the other? Or is this
some freak combination of comments and PHP tags? :-o
It is, I guess.
?php
$a = ' ? ';
$b = ' ? ';
?
will work just fine. If you try
Danny Brow wrote:
Wow I just wasted 10 minutes of my day reading half these post. This is
one long thread. And man is it hard to follow.
exactly why we don't want people posting off topic stuff here.
Dan.
--
Raditha Dissanayake.
From: karl james [EMAIL PROTECTED]
Ok I will try the links again, sorry about the hassel,
Did I miss the first part of this message?
http://www.theufl.com/movie_details.phps
website
http://www.theufl.com/php/wrox_php/movie_details.php
Are you able to tshoot it and see whats going
How about iterating though the strings and putting string values and
lengths in an array:
[begin untested code]
$strings = array('i','am','who');
$string_count = array();
foreach ($strings as $string) {
$string_count['value'][] = $string;
$string_count['length'][] = strlen($string);
}
Garyh wrote:
Below is a simple php file that recieves input from a form html file. The
php file outputs the first and last name, but their is no space between the
names. Does anyone know how I can get a space between name in the php file?
As a minimum this will work:
?
print(p$fusername.
Is it an associative array? That is, are you assigning values like this:
Method 1:
$arr[] = some text string;
or
$arr = array(some text string,some text string too);
or like this...
Method 2:
$arr[value1] = some text string;
or
$arr1 = array(value1=some text string,value2=some text string
On Tue, 21 Dec 2004 16:18:52 -0500 (EST), you wrote:
Any idea how to sort an array by string length?
You write a function that compares two strings (A and B), and returns
0 if len(A) == len(B), -1 if len(A) len(B) or +1 if len(A) len(B).
function compare_by_length ($a, $b)
{
$la = strlen
Hello people.
I got a little problem here, and I already searched on Google for
possible solutions, but I still can't figure how to fix it.
I'm developing a CMS Application on PHP. On my dev machine I'm running
Apache 1.3.33 + PHP 4.3.9 as a module, and on my production machine i'm
running Apache
I can't believe you can spend so much energy on this flame/agrovated
response crap when a small amount of that energy would have simply answered
this guys question.
No wonder there is so much war. Mostly started by people who know how to be
self sufficient. Don't worry. In 100 years we will all
Richard,
Thanks for your help.
The code (as I mentioned) was not mine. I did however find the example from
the link you sent me to and followed that. It works quite well.
Again, thanks for your time.
Darren
Richard Lynch [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I have
The problem I am having doesn't exactly use PHP but, if you guys would help
me out anyways, I would be very greatful.
Problem: I am using an image for the layout of the website. The image is
centered. I am trying to use a layer for the spots where content needs to be
added. However, depending on
First of all, use ?php than ?, just get used to it now rather than get
pissed later when it isnt a habit yet
Second, you dont need the two lines, write the following to get the space
?php
echo $fusername.' '.$lusername;
?
And you should have your nicely formatted name right there
?
print
John Holmes wrote:
From: Larry E. Ullman [EMAIL PROTECTED]
Do you honestly think people are learning __anything__
when you reply with a Yes?
Yes.
You used to be so nice and polite. ;)
--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List
Justin Palmer wrote:
snip
Not to start flame war about meat, but:
Do people still eat beef? Yuk.
Teach a man to pick soy beans... :) -- much healthier alternative...
(Da** I told myself not to post on this thread, thanks Matthew ;) )
Those poor defenseless soy beans. ;)
--
By-Tor.com
...it's all
Hello,
on 12/21/2004 05:10 PM Juan Nin said the following:
I saw a post at http://www.php.net/manual/en/ref.curl.php where it says:
Using the customrequest for a complete post is wrong. Libcurl will add
a partial url, the http version and the standard headers after the post
data - while this works
* Thus wrote Justin Palmer:
In an earlier thread labeled first letter, it was suggested that
substr() be used.
Just for the record the usage of
$str = 'a string';
$str[0];
Is strongly discouraged, it is recommended to use:
$str{0};
See Section (String access and modification by
* Thus wrote Francisco Javier Escoppinichi Fernandez:
Hello people.
I got a little problem here, and I already searched on Google for
possible solutions, but I still can't figure how to fix it.
I'm developing a CMS Application on PHP. On my dev machine I'm running
Apache 1.3.33 + PHP
* Thus wrote Anthony Baker:
Hey Folks,
Hoping someone can aid me with a newbie-ish question.
I often use PHP includes in my files to pull in assets, but I hard code
the relative path to the root html directory for the sites that I'm
working on in each file. Example below:
?php
Hi Curt,
* Thus wrote Francisco Javier Escoppinichi Fernandez:
Hello people.
I got a little problem here, and I already searched on Google for
possible solutions, but I still can't figure how to fix it.
I'm developing a CMS Application on PHP. On my dev machine I'm running
Apache 1.3.33 + PHP
* Thus wrote Francisco Javier Escoppinichi Fernandez:
Hi Curt,
* Thus wrote Francisco Javier Escoppinichi Fernandez:
Hello people.
I got a little problem here, and I already searched on Google for
possible solutions, but I still can't figure how to fix it.
I'm developing a CMS
I think i had a similar kind of problem as you described here. I used
a layer as a container for the other layers that had the content in them.
Then i just centered the container and used absolute positionings on the
inner layers. The simplified code might look something like this:
html
head
Hi
I'm trying to integrate PHP Support into a basic webserver i am creating
for personal use (Windows). However i've run into a problem.
I've got the _GET vars working, (using the QUERY_STRING Environment
Variable), yet i can't figure out how to get the _POST vars set.
my webserver has the
Shane Mc Cormack wrote:
Hi
I'm trying to integrate PHP Support into a basic webserver i am creating
for personal use (Windows). However i've run into a problem.
I've got the _GET vars working, (using the QUERY_STRING Environment
Variable), yet i can't figure out how to get the _POST vars set.
That works on a normal webserver yes.
However, I am programming my own, and I have the Posted Data stored in
the memory of the webserver, and when i execute the PHP.exe i need to
tell it what the PostData is somehow.
- Shane
John Nichel wrote:
Shane Mc Cormack wrote:
Hi
I'm trying to integrate
*Sorry Curt for sending this to you.*
Hi,
Well if any one is interested in the speed I set up an example that you
can go to. Though, when I run the example substr() is very neurotic (or
it seems that it is to me). It can process the same line of code at a
lot of different intervals, while
On Tue, 2004-12-21 at 23:47, Justin Palmer wrote:
*Sorry Curt for sending this to you.*
Hi,
Well if any one is interested in the speed I set up an example that you
can go to. Though, when I run the example substr() is very neurotic (or
it seems that it is to me). It can process the same
Curt Zirzow escribió:
* Thus wrote Francisco Javier Escoppinichi Fernandez:
Hi Curt,
* Thus wrote Francisco Javier Escoppinichi Fernandez:
Hello people.
I got a little problem here, and I already searched on Google for
possible solutions, but I still can't figure how to fix it.
I'm developing a
Why is substr all over the board in how fast it processes the same
string? Is it the server?
Kind regards,
Justin
-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 21, 2004 8:58 PM
To: [EMAIL PROTECTED]
Cc: PHP-General; 'Curt Zirzow'
Why reinvent the wheel by writing your own webserver? Apache allows for it
to be used within other products. Just redistrbute it according to the
license.
- Original Message -
From: Shane Mc Cormack [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, December 21, 2004 10:36 PM
I have my own reasons for wanting to write my own webserver, but thats
not the point here. I just need/want to know how to tell the PHP.exe
what the POST variables are.
- Shane
Travis Conway wrote:
Why reinvent the wheel by writing your own webserver? Apache allows for
it to be used within
* Thus wrote Justin Palmer:
Why is substr all over the board in how fast it processes the same
string? Is it the server?
Benchmarking can be a funny thing. Usually benchmarks take an
average of serveral thousand iterations in order to find the
average time it take something to do.
101 - 143 of 143 matches
Mail list logo