Search the Community
Showing results for tags 'switch'.
-
class ufo { const MP_SIZE_LARGE = 600; const MP_SIZE_MEDIUM = 400; const MP_SIZE_SMALL = 250; const LARGE = 'LARGE'; const MEDIUM = 'MEDIUM'; const SMALL = 'SMALL'; public $mp_size; public function desired_width() { switch ( $this->mp_size ) { case ufo::LARGE...
-
Hello, I don't know if this is possible. I want to make a switch between pages, lets say i have more than 100 pages and each page have a unique name.php. So what i want to do is when page equal to random-page.php SELECT * FROM `jobs` WHERE title LIKE '%news%' And for example how...
-
Is there a nicer, cleaner more efficient and less code way of achieving this? I have an array of rows from the database and 2 of the columns could have either of 2 values which give me 4 possibilities. I want to loop through each of them and assign the row to one of 4 arrays so they are all...
-
<html> <head> <!--title>Hello</title--> <link rel="stylesheet" href="uvcs.css" type="text/css" /> </head> <body> <div id=everything> <div id=header> This is the header </div> <div id=clear></div> <div id=navmenu> <div id=navmenu> <ul> <li>...
-
Hi, I'm making a code for determining the astrological sign of anyone. The code receives a date in this format "YYYY-MM-DD" and strips that string in year, month and day. So I've wrotten this function: //determinar signo public function Determinar(){ switch ($this->month){...
-
Hi, I have the code below that using for a simple login system (security not a concern at all) This code works but it now has around ten if statements (not included them all for clarity), would this be best written as a switch statement? if so can you help me code it. I can write basic switc...
-
I have a switch that uses a rand() to find the respective cases in between a number range, like so: switch($number = rand(1,10)) { case ($number > 1 && $number <= 5): doFunction(); break; case ($number > 5): doFunction(); break; } how would I use this in an ar...