$html = "Hello World <br> <br> </br>";
echo preg_replace('#(<br */?>[^a-zA-Z1-2]*\s*){1,}$#i', '', $html));
Wednesday, 13 November 2019
Regex
Menghilangkan semua tag <br> atau <br/> di akhir kalimat.
Sunday, 7 April 2019
Mengelola Berbagai Versi PHP
Untuk menggunakan berbagai versi PHP kita bisa menggunakan phpenv, tapi entah kenapa, jika di Mac phpenv ini lambat. Sebagai alternatif, untuk lingkungan Mac, kita bisa menggunakan tips yang dijelaskan di [2], jika ingin mengubah versi PHP yang digunakan, kita dapat menjalankan perintah :
phpv 7.4
Untuk instalasi di Mac :
brew tap shivammathur/php
brew install shivammathur/php/php@5.6
brew install shivammathur/php/php@7.0
brew install shivammathur/php/php@7.1
brew install shivammathur/php/php@7.2
brew install shivammathur/php/php@7.3
brew install shivammathur/php/php@7.4
brew install shivammathur/php/php@8.0
brew services start shivammathur/php/php@5.6
brew services start shivammathur/php/php@7.0
brew services start shivammathur/php/php@7.1
brew services start shivammathur/php/php@7.2
brew services start shivammathur/php/php@7.3
brew services start shivammathur/php/php@7.4
brew services start shivammathur/php/php
Referensi
- phpenv, Simple PHP version management, https://github.com/phpenv/phpenv
- macOS 11 Big Sur Nginx Setup: Multiple PHP Versions, https://kevdees.com/macos-11-big-sur-nginx-setup-multiple-php-versions/
Saturday, 30 March 2019
Bersahabat dengan Archive7z
...
Referensi
- Archive7z, This library provides handling of 7z files in PHP, https://github.com/Gemorroj/Archive7z
Saturday, 16 March 2019
Bersahabat dengan Guzzle
...
Referensi
- Passing cookies from browser to Guzzle 6 client, https://stackoverflow.com/questions/31882080/passing-cookies-from-browser-to-guzzle-6-client
Monday, 7 January 2019
PHP - MySQL 8.0
Error : PHP message: PHP Warning: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password]
https://stackoverflow.com/questions/50026939/php-mysqli-connect-authentication-method-unknown-to-the-client-caching-sha2-pa
https://stackoverflow.com/questions/50026939/php-mysqli-connect-authentication-method-unknown-to-the-client-caching-sha2-pa
Subscribe to:
Posts (Atom)