Jump to content

JAY6390

Members
  • Posts

    825
  • Joined

  • Last visited

Everything posted by JAY6390

  1. Why not just use $cars = array(); foreach($owners as $owner) { $cars[$owner['Car']]['Owner'][] = $owner['Owner']; }
  2. $output = preg_replace('~<p class=\'fb-like\'><iframe.*?</iframe></p>~sim', '', $input);
  3. JAY6390

    between

    $regex = '/\{([^\}]*)\}/'; preg_match($regex, $subject, $matches); echo $matches[1];
  4. '|^(http(s)?://)?[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i' That will remove the need for the http://
  5. str_replace is highly efficient. Your other option is to create a recursive script to work its way through all the files and save when it does the str_replace on each file. This would only need to be done once
  6. You could probably use a str_replace on the content of the include before outputting it to achieve this (assuming all images reside in the folders as you described, where it's named as the html page is, without the extension
  7. You could do this so much easier with my pagination class
  8. Bit hard to understand what it is you mean here Do you mean you want to have a script that uploads files to store the uploaded file on another server directly? You can do this by transferring from your server to the new one however it can't be done straight from the browser to a different server, and then processed by your script no
  9. Why not just check the error log files? This link might help you
  10. This usually happens when the Content-Type isn't set correctly. You will need to check that is the correct value (image/jpeg for example);
  11. You can put [/code] within a block and it doesn't cut off straight away?
  12. Very true. You can't parse a [/code] within a block. Those are the basic principles the parser works on
  13. Can you show an example of what you have that works and what you have that doesn't
  14. ^^ I edited my post after I pulled my head outta my ass
  15. -= EDIT =- Indeed - its getting far too late for me to be reading code
  16. It will only match so long as there is a + or - before it. If there isn't it won't match This is a better regex /([-|+])?\s*\d+\.\d{2}/ If it has to have the +/- before it remove the ? after the )
  17. You mean multiple numbers before the decimal? preg_match_all("/[-|+]\s\d+\.\d{2}/", $sym_price, $matches);
  18. return preg_replace('/\..*$/', '',BcAdd( BcAdd( '76561197960265728', $Parts[ '1' ] ), BcMul( $Parts[ '2' ], '2' ) )); Change the return line to that and see if it fixes it
  19. What was the name of the variable? replace $var below with the variable name echo $var[0]['url'];
  20. What does the print_r show exactly?
  21. SQL Injection happens for one circumstance - when you put user given data into a query and run it without sanitizing it. ALWAYS sanitize the data by removing anything that shouldn't be in there in the first place (like non-alphanumeric characters and/or tags) and run the data through mysql_real_escape_string before inserting it into your query Better still use something like prepared statements in mysqli
  22. Yours is in no way more accurate, mine adds the correct amount of seconds to the unix timestamp of the said time, and then formats it exactly like yours does. can you show me an example of how mine is different for any particular date?
  23. Wow that second line you used was very bloated Sergey, how about something like this $hour_diff = -4; $t = strtotime('2010-04-30 11:38:56'); $t = $t + ($hour_diff * 3600); $t1 = date('F jS, Y',$t); $t2 = date('h:i A',$t); echo $t1 , $t2;
×
×
  • 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.