본문 바로가기

IT/PHP

(8)
PHP FOREACH문 $arr = array(1, 2, 3, 4);foreach ($arr as &$value) {    $value = $value * 2;}// $arr is now array(2, 4, 6, 8)unset($value); // break the reference with the last element?> $arr1 = array("a" => 1, "b" => 2, "c" => 3);$arr2 = array("x" => 4, "y" => 5, "z" => 6);foreach ($arr1 as $key => &$val) {}foreach ($arr2 as $key => $val) {}var_dump($arr1);var_dump($arr2);?>The output is:array(3) { ["a"]=> int..
이미지관련 > 문자열이미지에 각종 필터를 적용한 결과 대단할것은 없는 강좌이지만, 제 강좌를 출처를 밝히고 외부로 퍼가는 것은 허용하지만, 다른 강좌의 자료나 책의 자료로 사용되거나 부분적인 인용은 허용하지 않습니다. 강좌는 php 5. 대를 기준으로 하며, 이미지 관련을 다룹니다. 이미지에 글을 쓰거나 이미지를 합치거나 하는 등의 내용을 다루어 볼까 합니다. 나중에는 간단한 짤방 만들기 같은 것도 할수 있지 않을까 싶습니다. 이미지관련 > 문자열이미지에 각종 필터를 적용한 결과 이번 내용은 문자열이미지에 여러가지 필터를 적용하고 그 결과를 확인해보는 내용입니다. 예제11 > study11.php 원본
제로보드 구조 파헤치기 1탄 제로보드 설치하고 이제 제로보드xe의 폴더 구조와 module layout skin addon 등에 대해서 자세히 알아봐야겠다. 말만 해놓고 막상 할려니 벌써부터 토나온다 ㅋㅋ 그래도 시작하기로 마음 먹었으니 한번 하는데 까지는 해봐야겠다. 먼저 참고 할만한 사이트는 좀 정해야겠다 그래야 배우는데 그나마 좀 도움이 될거같기때문에 ;; http://www.xeschool.com/xe/step1_1 http://www.conory.com/index.php?mid=note&category=3262
이미지 태그만 뽑아오는 정규표현식 php ]*src=[\"']?([^>\"']+)[\"']?[^>]*> http https체크하는 정규식$body = preg_replace('/((http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?)/', '\1', $body);
PHP 리다이렉션(페이지 이동)의 3가지 방법 1. 먼저 메타테그를 이용한 방법입니다.
뽐뿌 rss 파싱 include_once("./_common.php");$g4['rss_feed_table'] = "hd_rss_feed";$g4['rss_url'] = "http://www.ppomppu.co.kr/rss.php?id=";// 휴대폰 게시판$pp[] = array('channel'=>'ppomppu2', 'bo_table'=>'cafe');$pp[] = array('channel'=>'pmarket2', 'bo_table'=>'ppomppu2');// rss를 가져 옵니다.foreach ($pp as $row) {     $rss_url = $g4['rss_url'] . $row['channel'];    $rss = simplexml_load_file($rss_url);    if($rss)  {   ..
php) 네이버 실시간 검색어 키워드 가져오기 include_once "./_common.php";//네이버 실시간 인기검색어 ( 네이버메인 )function getPopularKeyword(){    /**    * @brief Get_PopularKeyword함수    * @return 네이버 인기검색어 순위를 원소로 하는 오브젝트 반환    */    $popret = range(1,10);    $szServer = "www.naver.com";    $fp  = fsockopen($szServer, 80, $errorno, $errstr, 30);    $string = "";    if(!$fp)    {        printf("%s(%s)",$errstr, $errno);    }    else    {        fputs ($f..
How to install Redis and Redis php client Redis — cache-storage for data that is stored in RAM. In this case you will get very fast data access. It is similar to memcache but Redis has vast opportunities of data storage. Redis allows you to store not only strings but also lists, sets, sorted sets and hashes. You can find more details about Redis onofficial Redis site. I recommend to install Redis from a source code. In this case you wil..