Programming/php2017. 1. 3. 10:25

간단하게 요약(?) 하자면

array에는 되도록이면 'a' 로 해서 확장없이 빠르게 처리하는게 유리할 듯?



echo $data["a"]    이 경우 "a" 안에 치환할게 있는지 검사후 그냥 문자열 "a" 로 인식합니다.

echo $data['a']     이 경우 'a' 는 문자열이므로 바로 $data 에서 index 가 'a' 인 값을 찾을 수 있습니다.

[링크 : http://www.technote.co.kr/php/technote1/board.php?board=study&command=body&no=138]


다음과 같이 더블쿼터의 경우 더블쿼터 안에 있는 문자열에서 변수 등 치환할 값이 있으면 

그를 치환하여 출력한다. 하지만 싱글쿼터의 경우에는 치환할 값을 찾지 않고 그대로 값을 출력한다. 

[링크 : http://luckyyowu.tistory.com/61]


Single quoted

The simplest way to specify a string is to enclose it in single quotes (the character ').

To specify a literal single quote, escape it with a backslash (\). To specify a literal backslash, double it (\\). All other instances of backslash will be treated as a literal backslash: this means that the other escape sequences you might be used to, such as \r or \n, will be output literally as specified rather than having any special meaning.

[링크 : http://php.net/manual/en/language.types.string.php#language.types.string.syntax.single]


Double quoted

If the string is enclosed in double-quotes ("), PHP will interpret the following escape sequences for special characters:

As in single quoted strings, escaping any other character will result in the backslash being printed too. Before PHP 5.1.1, the backslash in \{$var} had not been printed.

The most important feature of double-quoted strings is the fact that variable names will be expanded. See string parsing for details.

[링크 : http://php.net/manual/en/language.types.string.php#language.types.string.syntax.double]


<?php

$juice = "apple";


echo "He drank some $juice juice.".PHP_EOL;

// Invalid. "s" is a valid character for a variable name, but the variable is $juice.

echo "He drank some juice made of $juices.";

// Valid. Explicitly specify the end of the variable name by enclosing it in braces:

echo "He drank some juice made of ${juice}s."

?>


He drank some apple juice.

He drank some juice made of .

He drank some juice made of apples. 

[링크 : http://php.net/manual/en/language.types.string.php]

[링크 : http://php.net/manual/en/language.types.string.php#language.types.string.parsing]

'Programming > php' 카테고리의 다른 글

php pack / unpack  (0) 2017.01.04
php foreach / array  (0) 2017.01.03
php class 그리고.. 구조체가 없다?  (0) 2017.01.02
php 변수 스코프  (0) 2017.01.02
php print_r  (0) 2017.01.02
Posted by 구차니

단종된게 대개 그렇지만, 보안상의 이유로 더 이상 유지하지 않기로..

[링크 : http://blog.learningtree.com/rhel-7-new-features-samba-4-changes/]


요건 다 예전 문서가 되어버리네.

[링크 : https://help.ubuntu.com/community/Swat]

[링크 : https://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html]

Posted by 구차니
프로그램 사용/gcc2017. 1. 2. 15:14

'프로그램 사용 > gcc' 카테고리의 다른 글

문자열에 escape 로 특수문자 넣기  (0) 2017.06.19
gcc cpp type (유니코드 문자열)  (0) 2017.04.04
gcc make CFLAGS=-D 관련  (0) 2016.11.17
gcc -fPIC  (0) 2016.06.22
gcc dependency .d 파일?  (0) 2016.03.28
Posted by 구차니
프로그램 사용/aws2017. 1. 2. 11:50

Function as a Service

msec 단위과금


장점으로는 딱 서비스에 집중하고 서버 구성이나 운영은 전혀 고민할 필요없다. 정도?



[링크 : http://www.zdnet.co.kr/column/column_view.asp?artice_id=20160614172904]

[링크 : http://blog.aliencube.org/ko/2016/06/23/serverless-architectures/]

[링크 : https://aws.amazon.com/ko/blogs/korea/serverless-architecture-by-korean-developers/]

'프로그램 사용 > aws' 카테고리의 다른 글

aws EC2 요금제  (0) 2024.05.10
aws 스토리지  (0) 2024.05.06
aws 리전별 가격비교  (0) 2024.05.06
aws vpc  (0) 2024.05.06
아마존 AWS 가입  (0) 2024.04.22
Posted by 구차니
Programming/php2017. 1. 2. 09:33

->는 구조체가 아니라 클래스에 쓰는 애라..

[링크 : http://php.net/manual/kr/language.oop5.php]

    [링크 : http://php.net/manual/kr/language.oop5.constants.php]


그리고 구조체는 없으니까 array로 대체해서 쓰던가 말던가?!!

[링크 : http://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=qna_function&wr_id=313395]



php관련 예제들 중에 -> 나오면 일단 클래스 쓰고 있다고 보면 되겠군..

'Programming > php' 카테고리의 다른 글

php foreach / array  (0) 2017.01.03
php "str"과 'str' 차이점  (2) 2017.01.03
php 변수 스코프  (0) 2017.01.02
php print_r  (0) 2017.01.02
php 게시판  (0) 2016.12.28
Posted by 구차니
Programming/php2017. 1. 2. 09:18

음.. C로 치면 전역 변수로 쓰면

함수 내에서 반드시

$GLOBALS["var"]

이런식으로 불러와야 한다. 아구 귀찮아..


[링크 : http://php.net/manual/en/reserved.variables.globals.php]


아무튼 자매품(?)으로

$_GET

$_POST

$_SESSION 등이 있네

Table of Contents ¶

[링크 : http://php.net/manual/en/reserved.variables.php]

'Programming > php' 카테고리의 다른 글

php "str"과 'str' 차이점  (2) 2017.01.03
php class 그리고.. 구조체가 없다?  (0) 2017.01.02
php print_r  (0) 2017.01.02
php 게시판  (0) 2016.12.28
php db connection pool  (0) 2016.12.28
Posted by 구차니
분류가 모호한 글2017. 1. 2. 09:14

표준상 어쩔수 없이 그렇게 하는건 알고 있지만

매번 일일이 타이핑 하는것도 귀찮고 찾아보니

주소에서 가장앞 한글자 빼고(그럼 자동으로 http://를 제외하게 되니) 복사 하는것도 방법인듯


확장기능 설치는 더 귀찮..


[링크 : http://bryan7.tistory.com/757]

[링크 : http://stackoverflow.../copying-a-utf-8-url-from-browsers-address-bar-gives-only-the-ugly-encoded-one]

'분류가 모호한 글' 카테고리의 다른 글

카라비너 (독일어)  (0) 2017.04.01
샘플 pcb 5만원!  (0) 2017.02.24
NVD - National Vulnerability Database  (0) 2016.02.01
dense 3d reconstruction  (0) 2015.09.22
입식 책상  (0) 2015.09.01
Posted by 구차니
Programming/php2017. 1. 2. 09:09

db에서 값을 불러오면 array로 읽히는데

print 하면 Array 라고만 나와서

내용을 편하게 보는 법을 찾아 보니.. 이런 애가 있었네?


[링크 : http://m.blog.naver.com/diceworld/220295811114]

[링크 : http://php.net/manual/en/function.print-r.php]

[링크 : http://blog.habonyphp.com/entry/php-배열을-읽기-편하게-출력해-주는-printr-함수]

'Programming > php' 카테고리의 다른 글

php class 그리고.. 구조체가 없다?  (0) 2017.01.02
php 변수 스코프  (0) 2017.01.02
php 게시판  (0) 2016.12.28
php db connection pool  (0) 2016.12.28
php 로그인 예제 2  (0) 2016.12.27
Posted by 구차니
Linux2017. 1. 1. 07:19

stat으로는 시간을 볼 수 있낀한데 birth 까진 보기 힘들고

ext4에서는 저장은 한다고 한다.


그러니까 posix에서는 atime ctime mtime으로

마지막 접근 / 변경 / 수정 시간 정도 만 나오고


파일 시스템에서 값을 뺴내야 한다.

$ stat sshd_config

  File: ‘sshd_config’

  Size: 2551            Blocks: 8          IO Block: 4096   regular file

Device: b302h/45826d    Inode: 110939      Links: 1

Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)

Access: 2017-01-01 07:05:20.413654980 +0900

Modify: 2017-01-01 07:05:20.413654980 +0900

Change: 2017-01-01 07:05:20.433654929 +0900

 Birth: - 


$ sudo debugfs -R "stat /etc/ssh/sshd_config" /dev/mmcblk0p2

debugfs 1.42.12 (29-Aug-2014)


Inode: 110939   Type: regular    Mode:  0644   Flags: 0x80000

Generation: 2068774389    Version: 0x00000000:00000001

User:     0   Group:     0   Size: 2551

File ACL: 0    Directory ACL: 0

Links: 1   Blockcount: 8

Fragment:  Address: 0    Number: 0    Size: 0

 ctime: 0x58682ba0:67643244 -- Sun Jan  1 07:05:20 2017

 atime: 0x58682ba0:629f7f10 -- Sun Jan  1 07:05:20 2017

 mtime: 0x58682ba0:629f7f10 -- Sun Jan  1 07:05:20 2017

crtime: 0x58682ba0:629f7f10 -- Sun Jan  1 07:05:20 2017

Size of extra inode fields: 32

EXTENTS:

(0):1031812

(END) 


읭? 왜 ctime와 crtime이 같지?


[링크 : http://webdir.tistory.com/236]

[링크 : http://unix.stackexchange.com/questions/91197/how-to-find-creation-date-of-file]

'Linux' 카테고리의 다른 글

원격지 mac address 얻기  (0) 2017.03.13
리눅스 쉘에서 시리얼 포트로 쓰기  (0) 2017.02.15
ctime mtime.. 엌?!  (0) 2016.12.31
base64 유틸리티  (0) 2016.12.28
리눅스 런레벨  (0) 2016.12.12
Posted by 구차니
Linux2016. 12. 31. 10:10

ctime이 create가 아니라 change네..(inode)

mtime은 modify time


[링크 : http://onecellboy.tistory.com/223]

[링크 : https://www.unixtutorial.org/2008/04/atime-ctime-mtime-in-unix-filesystems/]

$ man ls

       -c     with -lt: sort by, and show, ctime (time of last modification of file status information); with -l: show ctime and sort by  name; otherwise: sort by ctime, newest first 

       -u     with  -lt:  sort by, and show, access time; with -l: show access time and sort by name; otherwise: sort by access time


'Linux' 카테고리의 다른 글

리눅스 쉘에서 시리얼 포트로 쓰기  (0) 2017.02.15
리눅스 파일 시간관련  (0) 2017.01.01
base64 유틸리티  (0) 2016.12.28
리눅스 런레벨  (0) 2016.12.12
yaffs2 / ext4 비교?  (0) 2016.11.04
Posted by 구차니