Jump to content

Zane

Administrators
  • Posts

    4,362
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Zane

  1. Zane

    IRC is back.

    I just started IRC back up again. Hopefully we're stable from now on. Hardware has been moved. Time will tell.
  2. Look at str_getcsv() error_reporting(E_ALL); ini_set('display_errors', true); $file="spreadsheet-file.csv"; $csv= file_get_contents($file); $array = array_map("str_getcsv", explode("\n", $csv)); echo "<pre>", print_r($array), "</pre>"; $tdata = null; foreach($array as $k=>$v) { $tdata[$k][] = $v; } echo "<pre>", print_r($tdata), "</pre>";
  3. Zane

    IRC is back.

    Yah, I know.. I've been looking into that, I installed PHP-FPM and that didn't help.. restarted both of them.. I've never used Nginx before, so it's a bit awkward to me.
  4. It's been back online for a week or so now, and I just realized that I forgot to announce the fact. So fire up your preferred IRC Client and come join the fun, learn some, teach some, and opine. irc.phpfreaks.com:6667
  5. If you're going to treat the id as a string, then use it like a string.. place quotes around the id $sql = "UPDATE `fruits` SET `type`='banana' WHERE fruitid = '$fruitid'";
  6. I can only imagine, I wish I had bought stock in Google too.
  7. Amazing how expensive those little bastards are.. $244 for 1 bitcoin.
  8. Zane

    Back online.

    The IRC server is back online again, thanks to thorpe (trq) for taking the time to restart the server for us.
  9. Zane

    Back online.

    The CPU IO rate went wild. Such that the system went idle. It shut everything off But with a squat and a cough The website re-birthed after awhile.
  10. Zane

    Back online.

    I wish i had an answer for IRC. I can't access that part. The hard drive ate too many badgers and became constipated.
  11. Agreed. PHP.net has the only manual you will ever need for PHP. If you're looking for tutorials or code snippets then Google is your friend.
  12. And we're back online... again! It may have taken 3-4 days, but we're back.
  13. There is no PHP 5.10 nor a PHP 5.11 These are the only current versions 5.6.5 5.5.21 5.4.37
  14. Why do you want to use regex when you could just as easily use PHP's plethora of string functions $filename = "some_thing_that.has.dots.in.the_filename.jpeg"; $last_period = strrpos($filename, '.'); if($last_period !== false) $extension = substr($filename, $last_period+1); else echo "No extension found"; And.. there is also a specific function that will grab the extension in one line of code. $extension = pathinfo($filename)['extension'];
  15. yum upgrade Update everything, then sudo yum install php mysql php-mysql php and mysql should be the more current one. You'll know before it installs, when it asks you if you would like to continue installing of what is reviewed above the question. If it doesn't say 5.6, then it's an older version, so you may have to search for the package. Either way, when it's all said an done, either restart apache, php and mysql, or just restart the entire server. I'm by no means a linux expert, but I've picked up bits and pieces along the way, I'm running Centos as well.
  16. and there is most likely, undoubtedly a lot of money involved.
  17. There are also HEREDOCs echo <<<JAVASCRIPTCODE <script type="text/javascript"> var banner = (function(){ $('.banner').unslider({ speed: 1000, // The speed to animate each slide (in milliseconds) delay: 999000, // The delay between slide animations (in milliseconds) complete: function() {}, // A function that gets called after every slide animation keys: false, // Enable keyboard (left, right) arrow shortcuts dots: false, // Display dot navigation fluid: true // Support responsive design. May break non-responsive designs }); $( '#nav li:has(ul)' ).doubleTapToGo(); }); </script> JAVASCRIPTCODE; Unless you're addicted to IDE font formatting, this is something I would do. More times than not though, it's a lot more tidier and organized to put the scripts in external files and include them, as someone already suggested.
  18. So it all boils down to preference and convenience then. Nothing extra-efficient in using it. Here, though, is an example of a usage of those semantics in a very aggravating way. <?php /** * Product list template * * @see Mage_Catalog_Block_Product_List */ ?> <?php $_productCollection=$this->getLoadedProductCollection(); $_helper = $this->helper('catalog/output'); ?> <?php if(!$_productCollection->count()): ?> <p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p> <?php else: ?> <div class="category-products"> <?php echo $this->getToolbarHtml() ?> <?php // List mode ?> <?php if($this->getMode()!='grid'): ?> <?php $_iterator = 0; ?> <ol class="products-list" id="products-list"> This is just a small snippet from Magento's files.
  19. Not to say that this occurs in every php software out there, but I far too occasionally notice that the application is written with scattered php open and close tags, for instance <?php if(true) ?> <?php { ?> Blah blah blah, because it's true <?php } else { ?> because it's not true <?php } ?> To me, it is extremely irritating. Regardless, I see a lot of open source software written this way and I can't help but think that there must be some underlying reason for it. Magento, for example, is written exactly in this manner. The templates are infested with these opened and closed php snippets. Obscurity is not security so I'm ruling security reasons out. Maybe it is more efficient? -- But I couldn't understand why, if so. It seems like that would put more of a drag on the system itself causing php to start and stop parsing continually and excessively, then again, I'm no expert in the field of memory consumption and other operating system complexities. Honestly, in my opinion, it is stupid. i would never write a program that way.. HEREDOCs are much more useful and eye pleasing than that awful <?php { ?> I had the misfortune a few months ago when I purchased an invoicing/customer maintenance system that I didn't know was written for PHP 5.2 or something lower, one that allowed short tags; and thus short tags were used in the same manner as I've described. Is this just plain disorganization or is there some deep-seated inner lining advantage that I'm not aware of?
  20. If you sell a good or service it must be taxed, at least in the US it has to be. Therefore buying a bunch of data [quota] and then selling it would be not much different from buying a bunch of cellphones and selling them. All I can tell you is that the data [quota] that you are selling better be bought at a wholesale price first or you're doing it all wrong. Even if you do manage to buy a ton of wholesale data to sell. the usage of that data will still be subject to the policies put forth by the providers of such data[quota]
  21. where is the php image processing script relative to the directory you're trying to upload to?
  22. If pictures is a directory in your webroot, as your example illustrates, then you can use /pictures Because: / is the root folder (Webroot in your case) ./ is the current folder ../ is the parent folder Also, if you do not put a slash, it is the same as ./ For example, pictures will load from the current directory
×
×
  • 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.