Uncategorized

php intl extension php

1) Use “port” to install php71-intl % sudo port install php71-intl (2) Copy intl.so into active php extensions directory % sudo cp /opt/local/lib/php/extensions/no-debug-non-zts-20090626/intl.so /usr/lib/php/extensions/no-debug-non-zts-20090626 (3) Add “extension=intl.so” into php.ini % emacs /etc/php.ini % diff /etc/php.ini~ /etc/php.ini 1018a1019 > extension=intl.so (4) Restart apache % sudo apachectl restart

Uncategorized

php71 osx problem

# 1. Install brew –> http://brew.sh/ # 2. run the following commands in your Terminal brew tap homebrew/dupes brew tap homebrew/versions brew tap homebrew/homebrew-php brew install –with-openssl curl brew install –with-homebrew-curl –with-apache php71 brew install php71-mcrypt php71-imagick # 3. Follow these instructions to make Apache and php-cli use the newer php executable and make the… Continue reading php71 osx problem

Uncategorized

PHP array list find min max of other value by duplicate value

<?php $arrayList = array(); $arrayList[0][‘index’] = ‘aaaaa’; $arrayList[0][‘id’] = 1; $arrayList[0][‘val’] = 5; $arrayList[1][‘index’] = ‘aaaaa’; $arrayList[1][‘id’] = 2; $arrayList[1][‘val’] = 4; $arrayList[2][‘index’] = ‘aaaaa’; $arrayList[2][‘id’] = 3; $arrayList[2][‘val’] = 1; $arrayList[3][‘index’] = ‘bbb’; $arrayList[3][‘id’] = 4; $arrayList[3][‘val’] = 22; $arrayList[4][‘index’] = ‘bbb’; $arrayList[4][‘id’] = 5; $arrayList[4][‘val’] = 43; $arrayList[5][‘index’] = ‘bbb’; $arrayList[5][‘id’] = 6;… Continue reading PHP array list find min max of other value by duplicate value

Uncategorized

php switch version

php -v (default PHP version) From PHP 7.0 to PHP 5.6: sudo a2dismod php7.0 sudo a2enmod php5.6 sudo update-alternatives –set php /usr/bin/php5.6 sudo service apache2 restart From PHP 5.6 to PHP 7.0: sudo a2dismod php5.6 sudo a2enmod php7.0 sudo update-alternatives –set php /usr/bin/php7.0 sudo service apache2 restart