Skip to content

Instantly share code, notes, and snippets.

@Nationalcat
Nationalcat / php 排序實作.md
Created June 1, 2023 13:06
使用 php foreach 實作排序

氣泡排序法

function bubbleSort($nums) {
    if (count($nums) <= 1) {
        return $nums;
    }
    // 為每個值去比對所有值
    foreach($nums as $currentKey => $currentNum) {
        foreach($nums as $nextKey => $nextNum) {
            // 如果 `當前值` 比 `被比較的值` 大,則與該值交換位置,已達到遞增排序。如要遞減,則改成小於即可。
@Nationalcat
Nationalcat / laravel_valet_ssl_problem.md
Last active July 14, 2021 09:13
Laravel Valet SSL problem
  1. Error message cURL error 60: SSL certificate problem: unable to get local issuer certificate

  2. search php openssl cafile setting and copy this path

// in php.ini
openssl.cafile = "/opt/homebrew/etc/openssl@1.1/cert.pem"
  1. make sure your OpenSSL is the latest (optional)
brew upgrade openssl@1.1