Ask a Question related to PHP Development, Design and Development.
-
Thomas Neumann #1
Looking for Optimization
hiya
I'd like to optimize a code snippet I wrote:
------------------------------------------------------------------------
while ($Girl = each($Girls)){
$AttGirl = "Attitude$Girl[value]";
if ($$AttGirl && ("-" != $$AttGirl))
$query .= " AND (swimsuits.attitude_" . strtolower($Girl[value]) . " = '" . $$AttGirl . "')";
}
------------------------------------------------------------------------
It would be quite cool if I could drop the second line. But I don't know
how to tackle this.
$Girls is a simple array:
$Girls = array('Ayane','Christie','Helena','Hitomi','Kasumi ','Leifang','Lisa','Tina');
It's quite possible that I'm on the wrong track and there's a much
cleaner approach. The above code resulted from optimizing this:
------------------------------------------------------------------------
if ($AttitudeAyane && ("-" != $AttitudeAyane))
$query .= " AND (swimsuits.attitude_ayane = '$AttitudeAyane')";
if ($AttitudeChristie && ("-" != $AttitudeChristie))
$query .= " AND (swimsuits.attitude_christie = '$AttitudeChristie')";
[repeat for other girls]
------------------------------------------------------------------------
$AttitudeAyane is defined elsewhere an may hold no value or something
along the lines of -,0,1,2,3,4 or 5
tschüß
thomas
--
Music->Playing: In Strict Confidence - Herzattacke
Who am I? Am I the|As the silence fades away / I gather strength for another day
only me? I am the|Another day I've to go through / Another day here without you
only me... right? |-- "Another day", L´âme Immortelle
Thomas Neumann Guest
-
pdf optimization
how to optimize pdf doc in c# -
3D optimization
HI All, I've made a 3D environment in lingo with Director MX, which uses some Havok physics - not much at the moment as I was concentrating on... -
Optimization Questions
I have been looking at other web sites in my field that are high up on the search engines that don't use keywords or descriptions. Is there... -
FTP Performance Optimization
:confused; We are trying to determine what exactly the "FTP Performance Optimization" setting does in the FTP window. Contribute defaults to this... -
Code optimization...
This is a trick question right? I mean, you know that there is only one element in the rsc.SelectedIndexes, so how would you optimize the loop. ... -
Fabian Wleklinski #2
Re: Looking for Optimization
Hi Thomas,
what about using $GLOBALS["Attitude" . $Girl["value"]]
instead of assigning and using $$AttGirl?
Greetings from Frankfurt / Germany,
Fabian Wleklinski
Fabian Wleklinski Guest



Reply With Quote

