Jump to content

John84

New Members
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral

About John84

  • Rank
    Newbie
  1. Seems to work very well, you are a life saver, thank you for all the help given
  2. WOW! That looks superb! I'll give it a try then let you know, thank you
  3. Yes very sorry, feeling a bit stupid now for my dumb example 😀 If I do a var_dump of the array then it comes out like 0 => string '1,930,9', 1 => string '2,370,3,4', 2 => string '6,930,9', 3 => string '3,930,2', 4 => string '8,370,2,1' so in that example, it would produce 0 => string '7,930,9', 1 => string '2,370,3,4', 2 => string '3,930,2', 3 => string '8,370,2,1'
  4. Also, sometimes it isnt a alphanumeric value for the car, sometimes it's a numeric value such as <input type="text" name="cars[]" value="3,930,2,8"> <input type="text" name="cars[]" value="6,370,7,1">
  5. Hi, thanks for response. The original array is created from a bunch of posted input values, that looks something like <input type="text" name="cars[]" value="1,BMW,15,13"> <input type="text" name="cars[]" value="8,BMW,15,13"> <input type="text" name="cars[]" value="3,Saab,5,2"> Annoyingly I dont have access to change any of the script which produces those inputs, all i can do is post them to my script
  6. Hi I have an array which looks a little like this, the first number in each array is a quantity $cars = array ( array(1,"BMW",15,13), array(8,"BMW",15,13), array(3,"Saab",5,2), array(4,"BMW",11,7), array(5,"Land Rover",17,15), array(6,"Saab",5,2) ); what I want to do is combine any array which matches another, but ignoring the quanitity value (first one). Then creating the array again and adding up the quanitity values and re-inserting them at the start. Therefore the end result would look like $cars = array ( array(9,"BMW",15,13), array(9,"Saab",5,2), array(4,"BMW",11,7), array(5,"Land Rover",17,15), ); Has anyone got any ideas on how I might do this? Thanks
  7. Hi all I have this htaccess code to 1: Remove php from any URLS 2: Add a slash to the URL RewriteEngine On # redirect PHP or HTM to no extension RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^\ ]+)\.(php|html?) [NC] RewriteRule ^ /%1/ [L,R=301] ## Adding a trailing slash RewriteCond %{REQUEST_FILENAME} !-f RewriteRule [^/]$ %{REQUEST_URI}/ [L,R=301] # check to see if the request is for a PHP file and rewite to no extension: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^/?(.*)$ /$1.php [L] If I go to www.domain.com/file.php then it redrects to www.domain.com/file/ which is good but if I go to www.domain.com/file then it doesnt redrect to www.domain.com/file/ How can I make it so if I go to www.domain.com/file then it adds the slash on the end Lastly. does the code look ok in terms of it conforming to the standards? Thanks, John
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.