Jump to content


Staff Alumni
  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by awjudd

  1. @indie I know I'm coming fairly late, but here is your Regex: \[sharedmedia=core:attachments:(\d+)\] https://rubular.com/r/fOGRTK3l3LcLx1
  2. Happy Pi Day!

    1. Philip
    2. Barand


      This side of the pond it's on 22/7

    3. awjudd


      It's both according to Wikipedia ;) ... why not celebrate it twice? :P


  3. You can use MySQL's REPLACE function http://dev.mysql.com/doc/refman/5.0/en/replace.html Either do it in a SELECT statement (non-permanent) or an UPDATE statement (changing the actual values in the table). ~awjudd
  4. Old: juddster New: awjudd Please and thank you
  5. Edit: Just realized "judda" was taken ... guess not
  6. $_POST[foo] and $_POST['foo'] both work because PHP will automatically upconvert single words of text that it doesn't know as a constant to a string. That said, using $_POST[foo] is slower because not only does it cause notices to be thrown but it has to check for any definitions before it can assume that it is a string. Sample: <?php $arr = array (); for ( $x = 0; $x < 1000000; $x++ ) { $arr [ foo ] = 'bar'; } ?> Time of execution: $ time php test.php real 0m1.641s user 0m1.424s sys 0m0.044s Versus: <?php $arr = array (); for ( $x = 0; $x < 1000000; $x++ ) { $arr [ 'foo' ] = 'bar'; } ?> Run Time: $ time php test.php real 0m0.467s user 0m0.292s sys 0m0.052s Yes, this is a highly exaggerated case but it is a decent example of how it is bad ~judda
  • 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.