본문 바로가기

728x90
반응형

코딩

(75)
[php] strpos() 특정 문자열 검색하기 function specific_characters($target, $value) { $msg = false; if(strpos($target, $value)): $msg = true; else: $msg = false; endif; return $msg; } $target = 'id@n'; specific_characters($target, '@n'); 결과 : true;
[PHP] 문자열 길이 가져오기 mb_strlen 함수 $len = mb_strlen("티스토리", "UTF-8"); echo $len; 결과 : 4
MySQL / MariaDB 외부 접속 허용 방법 MySQL /etc/mysql/mysql.conf.d/mysqld.cnf MariaDB /etc/mysql/mariadb.conf.d/50-server.cnf bind-address를 주석 처리하고 bind-address = 0.0.0.0 이렇게 변경해준다. 그리고 MySQL 서비스를 재시작한다. $ service mysql restart 그리고 mysql 접속을 해서 mysql> create user 'gs'@'%' identified by 'password'; Query OK, 0 rows affected (0.01 sec) mysql> grant all privileges on gs.* to 'gs'@'%'; Query OK, 0 rows affected (0.00 sec) mysql> flush ..
MariaDB Unix-socket plugin not loaded 문제 해결 플러그인 상태를 조회해본다. select host, user, plugin from mysql.user where user='root'; plugin이 unix_socket으로 되어있을것이다. plugin을 업데이트 해주자 update mysql.user set plugin = 'mysql_native_password'; flush privileges; quit 이제 mariaDB를 시작하고 다시 접속을 해보면 비번을 치고 들어가진다. sudo service mariadb start
mysql, mariaDB 버전 확인 mysql --version
[Mysql] 처음 마지막 값 추출 select min(field),max(field) from table
에디터 종류 https://ckeditor.com/ckeditor-4/download/?null-addons= CKEditor 4 - Download Latest Version Download a ready-to-use Latest Version of CKEditor 4 package. ckeditor.com https://nightly.ckeditor.com/22-03-05-07-04/full/samples/ CKEditor Sample Congratulations! If you can see CKEditor below, it means that the installation succeeded. You can now try out your new editor version, see its features, and ..
[PHP] in_array() 함수 배열안에 값이 존재하는지 확인 $ip_arr = array("127.0.0.1", "192.282.45.23", "0.0.0.0"); $ip = "127.0.0.1"; // in_array(확인할 값, 배열); if(in_array($ip, $ip_arr)): echo "ok"; else: echo "fail"; endif; 결과 : ok

728x90
반응형