Jump to content

mister5317

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mister5317's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Shoot, sorry, I don't see a place to move it...
  2. I found it a fun learning experience to make something as simple as "HELLO WORLD!" into a difficult process. I obfuscated my PHP below to just echo "HELLO WORLD!". Anyone else have a better example to echo "HELLO WORLD!"? <?php // Output = HELLO WORLD! function __e($_){echo$_; }function __($_){__e(chr ($_));}function _a(){$__ =func_get_args();foreach ($__ as$k=>$v)$a[$k]=$v; return$a;}foreach(_a(7,4 ,+11,11,14,-33,22,14,17, 11,3,-32)as$k=>$v){__(65 +$v);} Give it a shot, it more difficult to think of creative ways to make something out of the box like this.
  3. I think I have figured it out! <?php function roundTime($timestamp, $precision = 15) { $timestamp = strtotime($timestamp); $precision = 60 * $precision; return date('Y-m-d H:i:s', round($timestamp / $precision) * $precision); } // 2009-06-29 10:45:00 echo roundTime('2009-06-29 10:48:13'); ?>
  4. I have timestamps in a database that are from the creation time of the records. These timestamps are something like 2009-06-29 08:54:32. In this case, I would like to round this timestamp to the nearest 15 minute increment (00:00, 00:15, 00:30, or 00:45) so the end result for 2009-06-29 08:54:32 would be 2009-06-29 09:00:00. If the time stamp was 2009-06-29 09:07:17, then the end result would still be 2009-06-29 09:00:00. Another option, if possible, would be to always round up. Maybe have an argument in the function to round to nearest or to round up/down? Can someone help me build a function to do this? It would be greatly appreciated! Thank you!
  5. I have an array of hexadecimal color codes: Array ( [0] => 2060A0 [1] => 204080 [2] => 206080 [3] => 000000 [4] => A0A0A0 [5] => C0C0C0 [6] => 808080 [7] => E0E0E0 [8] => 404040 [9] => 80A0A0 [10] => 202020 [11] => 002020 ) I would like to sort the array by color. I tried a natsort() and that didn't work the way I would have liked. Does anyone have any ideas on how to accomplish this? Thanks!
  6. I also tried the instructions here: http://discussions.apple.com/message.jspa?messageID=8418099#8418099 I got to the configure command and had this problem: checking for MySQL support for PDO... yes, shared checking for mysql_config... /usr/local/mysql/bin/mysql_config checking for mysql_query in -lmysqlclient... no configure: error: mysql_query missing!?
  7. I wish. There is macports. How would I go about reinstalling Apache, PHP and MySQL without junking up my system or breaking the default install?
  8. Thank you! Can you help me debug what I have found? PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so' - (null) in Unknown on line 0 I also found this from a few days ago, but I haven't seen it in the logs recently. dyld: Library not loaded: /usr/local/mysql/lib/libmysqlclient.16.dylib Referenced from: /usr/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so Reason: no suitable image found. Did find: /usr/local/mysql/lib/libmysqlclient.16.dylib: mach-o, but wrong architecture Any ideas?
  9. Any ideas of where/what logs I should be looking at? What am I looking for?
  10. I have confirmed that I am editing the correct php.ini file. I also have the GD module installed. Once I commented the extension line for that module I no longer saw GD support with php -m or phpinfo();. After uncommenting it, I saw it in both locations again.
  11. Hmmm, I am editing the php.ini file listed on the info page as the "Loaded Configuration File".
  12. If I comment out the extension line, rerun php -m, pdo_mysql is no longer there. Once I uncomment the line again, I see pdo_mysql in php -m, but not with phpinfo();.
  13. I am running Apache/PHP on Leopard with the base install provided by Apple. I need support for pdo_mysql so I followed the directions at http://starfog.com/node/52. When I run php -m from the command line, I see that both PDO and pdo_mysql are listed. If I check my phpinfo page, I do not see pdo_mysql anywhere. What can I do to get pdo_mysql support on Leopard? Thanks!
  14. <?php $string = 'The quick brown fox jumped over the lazy dog.'; echo substr($string, 0, 25); // 'The quick brown fox jumpe' ?> The last parameter, 25, is the number of characters to print. See http://us2.php.net/substr for more information.
×
×
  • 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.