Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'array'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 16 results

  1. I'm running PHP files of example 2 from my computer and I got those following errors across pages. An error occurred in script 'D:\XAMPP\htdocs\ex2\html\views\home.html' on line 14: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given Array An error occurred in script 'D:\XAMPP\htdocs\ex2\html\shop.php' on line 32: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given Array An error occurred in script 'D:\XAMPP\htdocs\ex2\html\sales.php' on line 20: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given Array An error occurred in script 'D:\XAMPP\htdocs\ex2\html\wishlist.php' on line 80: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given Array An error occurred in script 'D:\XAMPP\htdocs\ex2\html\cart.php' on line 81: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given Array Can someone please tell me how to fix it? Thanks.
  2. having problem with my form: created checkbox using array; then I want to save the value of the array to the database
  3. Hi everyone. I'm trying to echo the values of an array inside HTML's <option> tag. The following should be echod: <option value="Moose Jaw,SK,Canada">Moose Jaw,SK,Canada</option> <option value="Prince Albert,SK,Canada">Prince Albert,SK,Canada</option> <option value="Regina,SK,Canada">Regina,SK,Canada</option> <option value="Saskatoon,SK,Canada">Saskatoon,SK,Canada</option> The code I attempted was: <!DOCTYPE html> <html> <body> <?php $sk=array("Saskatoon","Regina","Moose Jaw", "Prince Albert"); sort($sk); foreach ($sk as $value) { echo '<option value="'.$value.',SK,Canada">'.$value.',SK,Canada</option>'; echo "<br>"; } ?> </body> </html> Pls. note that the values of the array are not sorted alphabetically. The output, however, should be sorted in ascending format and be within the <option> tag after adding the province and country. Any help will be highly appreciated.
  4. I have a form like the one below which is posted to processForm.php, and the user can dynamically add more with jquery. <input type="text" name="subject[ ]" /> <input type="text" name="grade[ ]" /> <input type="text" name="year[ ]" /> <input type="text" name="subject[ ]" /> <input type="text" name="grade[ ]" /> <input type="text" name="year[ ]" /> <input type="text" name="subject[ ]" /> <input type="text" name="grade[ ]" /> <input type="text" name="year[ ]" /> Please How can i access those arrays from subject[], grade[] and year[] inputs by the user?
  5. Hi, Can someone please tell me what the best way is to remove a key-value pair from a single-dimension array where you know the value but not the key. (In PHP). Any advice will be most appreciated. Thanks, Necuima.
  6. I've been banging on the following error for awhile and I cannot tell what is wrong, please help: Catchable fatal error: Argument 2 passed to ShapeFactory::Create() must be an array, string given, called in /home/content/14/11625314/html/AdvPHPwOOP/factory.php on line 22 and defined in /home/content/14/11625314/html/AdvPHPwOOP/ShapeFactory.php on line 11 I'm using PHP 5.3 thru goDaddy Here's the code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Factory</title> <link rel="stylesheet" href="style.css"> </head> <body> <?php # Script 7.4 - factory.php // This page uses the ShapeFactory class (Script 7.2). // Load the class definitions: require('ShapeFactory.php'); require('Shape.php'); require('Triangle.php'); require('Rectangle.php'); // Minimal validation: if (isset($_GET['shape'], $_GET['dimensions'])) { // Create the new object: $obj=ShapeFactory::Create($_GET['shape'],$_GET['dimensions']); // Print a little introduction: echo "<h2>Creating a {$_GET['shape']}...</h2>"; // Print the area: echo '<p>The area is ' . $obj->getArea() . '</p>'; // Print the perimeter: echo '<p>The perimeter is ' . $obj->getPerimeter() . '</p>'; } else { echo '<p class="error">Please provide a shape type and size.</p>'; } // Delete the object: unset($obj); ?> </body> </html> **************** <?php # Script 7.3 - ShapeFactory.php // This page defines a ShapeFactory class which uses the Factory pattern. /* The ShapeFactory class. * The class contains no attributes. * The class contains one method: Create(). */ abstract class ShapeFactory { // Static method that creates objects: static function Create($type, array $sizes) { // Determine the object type based upon the parameters received. switch ($type) { case 'rectangle': return new Rectangle($sizes[0], $sizes[1]); break; case 'triangle': return new Triangle($sizes[0], $sizes[1], $sizes[2]); break; } // End of switch. } // End of Create() method. } // End of ShapeFactory class.
  7. I am writing a little script to read files in a folder (photos) returning an array of file name and file size. Can mysqli handle a prepared statement inserting an array? Would be nice to insert 500 photo names at once rather than typing them all in. Ps.. Not for a public site, just a script i run on a home server to build a site. Tx
  8. Hello, everyone. I created a multidimensional array that consists of 4 music genres in which each genre has 3 artists(using strings as keys) who in turn have 4 albums each(string values), but when I iterate over the multidimensioal array with a foreach loop, only the first album(the 1st string value) is associated with the artist(the string key). My intention was to map multiple string values to each string key/index, and have an output as such. Artist: Miles Davis Albums: Kind of Blue, Bitches Brew, Sketches of Spain, Birth of the Cool. Here's the code: <?php $jazz = array ( 'Miles Davis' => 'Kind of Blue', 'Bitches Brew', 'Sketches of Spain', 'Birth of the Cool', 'John Coltrane' => 'A Love Supreme', 'Blue Train', 'Giant Steps', 'My Favorite Things', 'Dave Brubeck' => 'Time Out', 'Time Further Out', 'Times Changes', 'Indian Summer', ); $classic_rock = array ( 'The Beatles' => 'Abbey Road', 'Sgt. Pepper\'s Lonely Hearts Club', 'Revolver', 'Rubber Soul', 'Pink Floyd' => 'The Dark Side of The Moon', 'The Wall', 'Wish You Were Here', 'Meddle', 'The Doors' => 'Doors', 'Strange Days', 'L.A Woman', 'Morrison Hotel', ); $alternative_rock = array ( 'Pearl Jam' => 'Ten', 'Vs.', 'Yield', 'No Code', 'Radiohead' => 'Pablo Honey', 'Kid A', 'O.K Computer', 'In Rainbows', 'Dave Matthews Band' => 'Under the Table and Dreaming', 'Busted Stuff', 'Crash', 'Before These Crowded Streets', ); $indie_rock = array ( 'The National' => 'Boxer', 'High Violet', 'Sad Songs for Dirty Lovers', 'Cherry Tree', 'Interpol' => 'Turn On The Bright Lights', 'Antics', 'Interpol', 'Our Love To Admire', 'The Radio Dept.' => 'Pet Grief', 'Clinging To A Scheme', 'Lesser Matters', 'Passive Aggressive', ); $music = array ( 'Jazz' => $jazz, 'Classic Rock' => $classic_rock, 'Alternativ Rock' => $alternative_rock, 'Indie Rock' => $indie_rock, ); foreach ($music as $genre => $artists) { print "<p>Genre: $genre"; foreach ($artists as $artist => $albums) { print "<br />" . "Artist: " . $artist . "\t" . "Albums: " . "$albums"; } print '</p>'; } ?> Here's the output: Genre: Jazz Artist: Miles Davis Album: Kind of Blue Artist: 0 Album: Bitches Brew Artist: 1 Album: Sketches of Spain Artist: 2 Album: Birth of the Cool Artist: John Coltrane Album: A Love Supreme Artist: 3 Album: Blue Train Artist: 4 Album: Giant Steps Artist: 5 Album: My Favorite Things Artist: Dave Brubeck Album: Time Out Artist: 6 Album: Time Further Out Artist: 7 Album: Times Changes Artist: 8 Album: Indian Summer Genre: Classic Rock Artist: The Beatles Album: Abbey Road Artist: 0 Album: Sgt. Pepper's Lonely Hearts Club Artist: 1 Album: Revolver Artist: 2 Album: Rubber Soul Artist: Pink Floyd Album: The Dark Side of The Moon Artist: 3 Album: The Wall Artist: 4 Album: Wish You Were Here Artist: 5 Album: Meddle Artist: The Doors Album: Doors Artist: 6 Album: Strange Days Artist: 7 Album: L.A Woman Artist: 8 Album: Morrison Hotel Genre: Alternativ Rock Artist: Pearl Jam Album: Ten Artist: 0 Album: Vs. Artist: 1 Album: Yield Artist: 2 Album: No Code Artist: Radiohead Album: Pablo Honey Artist: 3 Album: Kid A Artist: 4 Album: O.K Computer Artist: 5 Album: In Rainbows Artist: Dave Matthews Band Album: Under the Table and Dreaming Artist: 6 Album: Busted Stuff Artist: 7 Album: Crash Artist: 8 Album: Before These Crowded Streets Genre: Indie Rock Artist: The National Album: Boxer Artist: 0 Album: High Violet Artist: 1 Album: Sad Songs for Dirty Lovers Artist: 2 Album: Cherry Tree Artist: Interpol Album: Turn On The Bright Lights Artist: 3 Album: Antics Artist: 4 Album: Interpol Artist: 5 Album: Our Love To Admire Artist: The Radio Dept. Album: Pet Grief Artist: 6 Album: Clinging To A Scheme Artist: 7 Album: Lesser Matters Artist: 8 Album: Passive Aggressive Any help is appreciated, but what I'd really like to understand is what I'm doing wrong/ or missing here. Thanx.
  9. Ref. p.164 "Creating Multidimensional Arrays" Wondering why I keep getting "Notice"s about "Array to string conversion". I think this is covered in the book but I can't seem to find the place right now (or, I'm being lazy). I'm using Notepad v. 6.3 with XAMPP v. 3.1.0.3.1.0 with PHP v.5.4.7 and testing in Firefox (latest). Here's the "error": -------------------------------------------------------------------------------------------------------------------------- Notice: Array to string conversion in C:\xampp\htdocs\test\multidimensional_arrays\books.php on line 49 PHP VQS: Array -------------------------------------------------------------------------------------------------------------------------- I think it's covered on p.64 Error Reporting and has something to do with E_NOTICE settings. But, the program runs OK (as per the output below). I'm just wondering why it reports this "notice", or if I'm doing something wrong. Is it really performing an array-string conversion? If anything, it should non-report that I'm doing a normal, regular array-value output, where the value happens to be a string. Should I turn this "notice" off? error_reporting(0); The only slightly-odd thing I noticed while coding (using Notepadd++ v.6.3) is it keeps reporting xml:lang="en" as an unrecognized tag and colors it differently as per NPP's coloring scheme, i.e. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> Lets paste something from the PHP Manual, just for fun: Note: Enabling E_NOTICE during development has some benefits. For debugging purposes: NOTICE messages will warn you about possible bugs in your code. For example, use of unassigned values is warned. It is extremely useful to find typos and to save time for debugging. NOTICE messages will warn you about bad style. For example, $arr[item] is better to be written as $arr['item'] since PHP tries to treat "item" as constant. If it is not a constant, PHP assumes it is a string index for the array. ------------------------------------------------------------------------------------------------------------------------- My output: PHP:Groceries and Arrays - groceries.php The third chapter of my first book is HTML Forms and PHP. The first chapter of my second book is Advanced PHP Techniques The third chapter of my third book is Advanced Database Concepts Notice: Array to string conversion in C:\xampp\htdocs\test\multidimensional_arrays\books.php on line 49 PHP VQS: Array Notice: Array to string conversion in C:\xampp\htdocs\test\multidimensional_arrays\books.php on line 49 PHP Advanced VQP: Array Notice: Array to string conversion in C:\xampp\htdocs\test\multidimensional_arrays\books.php on line 49 PHP and MySQL VQP: Array ---------------------------------------------------------------------------------------------------------------------------------------------- Here is the full code I used: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>PHP:Multidimensional Arrays</title> </head> <body> <h2>PHP:Groceries and Arrays - groceries.php</h2> <br /> <?php $phpvqs = array( 1 => 'Getting Started with PHP', 'Variables', 'HTML Forms and PHP', 'Using Numbers'); //uses no.s for keys and strings for values //no.1 above refers to chapter 1 $phpadv = array( 1 => 'Advanced PHP Techniques', 'Developing Web Applications', 'Advanced Database Concepts', 'Security Techniques'); $phpmysql = array( 1 => 'Introduction to PHP', 'Programming with PHP', 'Creating Dynamic Web Sites', 'Introduction to MySQL'); $books = array ( 'PHP VQS' => $phpvqs, 'PHP Advanced VQP' => $phpadv, 'PHP and MySQL VQP' => $phpmysql ); //uses strings for keys and arrays for values //print out the name of the third chapter of the PHP //Visual QuickStart Guide //print "{$books['PHP VQS'][2]}"; //above line is wrong - 3rd chap is at index 3 print "<p>The third chapter of my first book is <i>{$books['PHP VQS'][3]}.</i></p>"; print "<p>The first chapter of my second book is <i>{$books['PHP Advanced VQP'][1]}</i></p>"; print "<p>The third chapter of my third book is <i>{$books['PHP Advanced VQP'][3]}</i></p>"; foreach ($books as $key => $value) { print "<p>$key: $value</p>\n"; } //the $key variable gets each abbreviated book title //the $value variable contains each chapter-array //compare to //$list = array( //1 => 'apples', //2 => 'bananas', //3 => 'oranges' //); //arrays automatically begin their indexing at 0, unless otherwise specified. You can assign the index when using array() as above ?> <pre> <?php print_r ($books); var_dump($books); foreach ($books as $title => $chapters) { print "<p>$title"; foreach ($chapters as $number => $chapter) { print "<br />Chapter $number is $chapter"; } print "</p>"; } ?> </pre> </body> </html> <pre style="visibility:hidden"> Comments: <!-- Multidimensional arrays: - you use arrays as elements instead of strings or numbers ------------------------------------------------------------------- --> </pre>
  10. Version 0.5 page 157 Quote: "# protected/controllers/SiteController.php public function actions() { return array( 'page' => array('class' => 'CViewAction', 'defaultView' => 'about') ); } To change the layout used to encase the view, assign the alternative layout name to the layout attribute in that array." Larry, I understand the example, but not the last sentence. It doesn't seem to relate to the example. Can you please explain it in other words? Thanks.
  11. I have a question, inspired by the "Random Quotes" mini-application, used as an example of writing to a file and reading from a file, in Chapter 11 of this book. The "read from file" part of this application picks a random quote from an array, and outputs it to a web browser. I want to figure out the simplest way to improve this script, so that the random quotes that it outputs are not repeated, as long as there are quotes left in the file. For example, the script has output the array element # 0. I want it to remember that the element # 0 has been output, and the next time to output any other element of the array, but not 0 - and so on, until the script runs out of quotes, in which case it can start over again. I'm not asking this for any important or practical reason, but I'm just curious, if a simple an elegant solution could be found. Would appreciate a creative suggestion!
  12. Hello every one may some one can help me in this issue. When I use Literal syntax for Array like this: var name = ['name1', 'name2', 'name3', 'name4']; alert(name[2]); it return to characters in Array, but when i use it like this way: var names = ['name1', 'name2', 'name3', 'name4']; alert(names[2]); it return to the name3 at full not just one character on it. So my question is, there any point i miss to learn about this technique, or it could be problem in language ?
  13. I've read through the book, and now I'm working through it bit by bit; I am so hung up on this one subject that I need to ask for some clarification. In script 2.7 I'm working through arrays, and how to indicate strings, etc. On p. 64 the box on the right says that multi-dimensional arrays can also come from an html form- and since this is what I want to figure out how to create, I thought I would try to write the correct syntax for this to understand it thoroughly. Here's the code- a simple form that has check boxes and then sub check boxes; I realize this might be a bit more complex than the example but it indicates best what I want to try to work through. <?php $letts = array( $_POST['letters'], ); if ($_SERVER['REQUEST_METHOD'] == 'POST') { foreach($letts as $title => $list) { echo "<h3>$title</h2><ul>\n"; foreach($title as $k => $v) { echo "<li>$k - $v</li>\n"; } } echo '</ul>'; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> body, ul, li { list-style-type: none; } </style> </head> <body> <form action="page1.php" method="post"> <fieldset> <legend>My Form</legend> <fieldset> <legend>Letters and Numbers: 1</legend> <ul> <li> <input type="checkbox" name="letters[]" value="Alpha" /> Alpha <ul> <li><input type="checkbox" name="numbers[]" value="One" /> One</li> <li><input type="checkbox" name="numbers[]" value="Two" /> Two</li> <li><input type="checkbox" name="numbers[]" value="Three" /> Three</li> <li><input type="checkbox" name="numbers[]" value="Four" /> Four</li> </ul> </li> </fieldset> <fieldset> <legend> Two:</legend> <ul> <li> <input type="checkbox" name="letters[]" value="Beta" /> Beta <ul> <li><input type="checkbox" name="numbers[]" value="One" /> One</li> <li><input type="checkbox" name="numbers[]" value="Two" /> Two</li> <li><input type="checkbox" name="numbers[]" value="Three" /> Three</li> <li><input type="checkbox" name="numbers[]" value="Four" /> Four</li> </ul> </li> </ul> </fieldset> <fieldset> <legend> Teh Three:</legend> <ul> <li><input type="checkbox" name="letters[]" value="Charlie" /> Charlie <ul> <li><input type="checkbox" name="numbers[]" value="One" /> One</li> <li><input type="checkbox" name="numbers[]" value="Two" /> Two</li> <li><input type="checkbox" name="numbers[]" value="Three" /> Three</li> <li><input type="checkbox" name="numbers[]" value="Four" /> Four</li> </ul> </li> </ul> </fieldset> <fieldset> <legend> Four!</legend> <ul> <li><input type="checkbox" name="letters[]" value="Delta" /> Delta <ul> <li><input type="checkbox" name="numbers[]" value="One" /> One</li> <li><input type="checkbox" name="numbers[]" value="Two" /> Two</li> <li><input type="checkbox" name="numbers[]" value="Three" /> Three</li> <li><input type="checkbox" name="numbers[]" value="Four" /> Four</li> </ul> </li> </ul> </fieldset> <br /> <input type="submit" value="submit" name="Submit!!" /> </fieldset> </form> </body> </html> I should say, this is the latest version; previous versions (I've tried a lot of different things but realize that I'm just altering things without understanding what is really going wrong) have returned different errors such as illegal string offset. This one returns the warning that you gave a tip for on page 61- invalid argument foreach. So I'm trying to use a foreach loop on a variable that is not an array- but I suppose I don't understand why it is not an array- is it because the letters[] and numbers[] are not given a relation? should they all have the same name? I thought it was because in some instances I checked only one option- so I tried going through each list and checking multiple in each one. Then I realized that this wouldn't work anyway, because I don't want to create any sort of form where multiple check box values are required instead of optional. If you had any insight on this I would be grateful. Thanks!
  14. What is the fastest and easiest way to move the fetched data into an array using prepared statements? Everything I do seems ad-hoc. ... we bind results in two variable $col1 and $col2 ... $x = 0; $myarray = array(); while(mysqli_stmt_fetch($stmt)){ $myarray[$x]['col1'] = $col1; $myarray[$x]['col2'] = $col2; $x++; } ... Now we have a multidimensional array $myarray (what I want). However, if I have more variables seems a little inconvenient to repeat over and over again... I wonder if there is any way faster or better.
  15. I want to convert an XMLList into an Array (not an ArrayCollection). I do understand that an ArrayCollection is actually only a wrapper around an Array & at the heart of an ArrayCollection is in fact an Array. At this stage I can convert the XMLList into an ArrayCollection like so: testInfo = event.result.node; // testInfo is an XMLList myData = new ArrayCollection(mx.utils.ArrayUtil.toArray(testInfo.LoadType)); // myData is an ArrayCollection. Testing (component implementation), the only way I’ve been able to access the content (stripped of start & end XML tags) is like so: In a combobox: <mx:ComboBox dataProvider="{myData.getItemAt(0)}" /> or in a List: <mx:List dataProvider="{testInfo}" labelField="LoadType"/> If I use <mx:ComboBox dataProvider="{myData}"/> without the getItemAt(0)-part, the start & end XML tags are still included. Why??? The reason I want an Array is to ultimately use it in a PieSeries to bind to perWedgeExplodeRadius. I'm using Flex 4 with FlashBuilder IDE. Thanks.
  16. Hello This is an application of page 302, my variant exercise Been trying for the last two days to get the arguments sent by an object which calls a method, to an array which is in that method, and said array only gets the first of the arguments, as if it were a single scalar variable and not an array. UPDATE Someone solved the issue for me. The problem was that I was not passing the array into the object. I have to create the array, put the elements in there and then This is the code that sends the arguments require_once 'vehicle.php'; require_once 'Motorbike.php'; $v1 = 200; // actually these are distances run at after 5, 10 and 15 seconds $v2 = 300; $v3 = 450; $suzuki = new Motorbike(); $speeds = $suzuki->speed($v1, $v2, $v3); echo "Speeds are: "; foreach($speeds as $speed) { echo $speed . "<br />"; } UPDATED $v = array(50, 20, 600); $suzuki = new Motorbike(); $speeds = $suzuki->speed($v); echo "Speeds are: "; foreach($speeds as $speed) { echo $speed . "<br />"; } <?php class Motorbike extends Vehicle { protected $bikes_speed = array(); protected $speeds = array (); public function speed($speeds){ foreach($speeds as $speed) { $this->bikes_speed[] = $speed/5; } return $this->bikes_speed; } } but this public function with argument $speeds, which is an array, is not getting the 3 values that I sent it from the code above, only the 200
×
×
  • Create New...