Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,159 members, 7,821,937 topics. Date: Wednesday, 08 May 2024 at 10:16 PM

Current Babes Php Quiz - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Current Babes Php Quiz (1839 Views)

Most Confusing And Simple Maths Quiz / Dhtml Quiz: How Will You Detect If A Browser Support Javascript From Php Code? / Very Easy Html/php Quiz :) (2) (3) (4)

(1) (Reply) (Go Down)

Current Babes Php Quiz by Nobody: 1:13pm On Jul 17, 2011
$babes = array(
'monday' => 'Shade',
'tuesday' => 'Linda',
'wednesday' => 'Ify',
'thursday' => 'Julieta',
'friday' => 'Titilola');

while ($babe = current($babes)) {
//todo: get day wey them book the current babe
echo "<li>$day => $babe";
//code to continue so we dont loop indefinitely
}

Question: put the missing code into the todo line. Please do not use array_keys, array_search, for, each

Hint: Well, this has already been given. . . .
Re: Current Babes Php Quiz by Nobody: 2:38pm On Jul 17, 2011
//my attempt
$babe=current($babes) //current value from array from ur code

//to get day[assuming no use of arra_keys,search,for,each
$day=key($babes);
Re: Current Babes Php Quiz by Nobody: 2:41pm On Jul 17, 2011
Yay! and pc guru gets to win the sunday babe. . . .no espera, the array will still not work?

$babes = array(
'monday' => 'Shade',
'tuesday' => 'Linda',
'wednesday' => 'Ify',
'thursday' => 'Julieta',
'friday' => 'Titilola');

while ($babe = current($babes)) {
$day=key($babes); //corecta
echo "<li>$day => $babe";
//todo: code to continue so we dont loop indefinitely
}

Okay, i have applied your correction :: but now, we are only halfway done.
Re: Current Babes Php Quiz by Nobody: 2:48pm On Jul 17, 2011
Sorry didn't see that part
while ($babe = current($babes)) {
$day=key($babes); //corecta
echo "<li>$day => $babe";
if(key($babes) == end($babes))
{
return true;
}
}
Re: Current Babes Php Quiz by Nobody: 2:54pm On Jul 17, 2011
No way, the solution has something to do with babes ($babes)


$babes = array(
'monday' => 'Shade',
'tuesday' => 'Linda',
'wednesday' => 'Ify',
'thursday' => 'Julieta',
'friday' => 'Titilola');

while ($babe = current($babes)) {
$day=key($babes);
echo "<li>$day => $babe";
//todo: kiss($babes);
}

There is just one function left, just replace the kiss with the function. The function is a 4 letter word like kiss - and we use it
sometimes when we want to leave a babe and go for another babe.


Disclaimer: The babes we are talking about on this thread are dual core's virtual servers - they are like babes in a way - you can find them on http://www.sisvps.com
Re: Current Babes Php Quiz by Nobody: 3:01pm On Jul 17, 2011
Sorry didn't see that part
while ($babe = current($babes)) {
$day=key($babes); //corecta
echo "<li>$day => $babe";
if(key($babes) == end($babes))
{
return true;
}
}

i think that part is unnecessary

if($babes === FALSE)
endwhile;
Re: Current Babes Php Quiz by Nobody: 3:03pm On Jul 17, 2011
No way,

$babes = array(
'monday' => 'Shade',
'tuesday' => 'Linda',
'wednesday' => 'Ify',
'thursday' => 'Julieta',
'friday' => 'Titilola');

while ($babe = current($babes)) {
$day=key($babes);
echo "<li>$day => $babe";
//todo: kiss($babes);
}

Solution is just to replace kiss with the right function. . .
Re: Current Babes Php Quiz by Nobody: 3:04pm On Jul 17, 2011
you mean the next function
if(next($babe) != true)
terminate;

//i felt since the current points to the current value
//Well i tried  grin
Re: Current Babes Php Quiz by Nobody: 3:48pm On Jul 17, 2011
But of course: the correct sensible thing to do after a current babe is to get a next babe:


$babes = array(
'monday' => 'Shade',
'tuesday' => 'Linda',
'wednesday' => 'Ify',
'thursday' => 'Julieta',
'friday' => 'Titilola');

while ($babe = current($babes)) {
$day=key($babes);
echo "<li>$day => $babe";
next($babes);
}
Re: Current Babes Php Quiz by yawatide(f): 6:33am On Jul 18, 2011
Wow! I find this thread more interesting than the recently released Harry Potter movie. Oya! time to go grab some popcorn and watch from the sidelines. Hopefully, this one comes in 3D cheesy
Re: Current Babes Php Quiz by Nobody: 11:33pm On Jul 19, 2011
@least i am happy you liked the babes quiz.

(1) (Reply)

A Webdesigner Needed / Wordpress Automobile/property Listings Plugin With Thumbnail / Why Don't Naija Bloggers Help Each Other? If You Teach Someone Will You Die?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 16
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.