<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="http://wiki.rookie-inc.com/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://wiki.rookie-inc.com/feed.php">
        <title>メモとかメモのようなものとか（By ルーキーの中のひと） - development:language:php:snippets</title>
        <description></description>
        <link>http://wiki.rookie-inc.com/</link>
        <image rdf:resource="http://wiki.rookie-inc.com/_media/wiki/dokuwiki.svg" />
       <dc:date>2026-04-04T11:08:40+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://wiki.rookie-inc.com/development/language/php/snippets/randomstr"/>
                <rdf:li rdf:resource="http://wiki.rookie-inc.com/development/language/php/snippets/urlencode"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://wiki.rookie-inc.com/_media/wiki/dokuwiki.svg">
        <title>メモとかメモのようなものとか（By ルーキーの中のひと）</title>
        <link>http://wiki.rookie-inc.com/</link>
        <url>http://wiki.rookie-inc.com/_media/wiki/dokuwiki.svg</url>
    </image>
    <item rdf:about="http://wiki.rookie-inc.com/development/language/php/snippets/randomstr">
        <dc:format>text/html</dc:format>
        <dc:date>2017-04-14T05:21:33+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>ランダムな文字列を生成する</title>
        <link>http://wiki.rookie-inc.com/development/language/php/snippets/randomstr</link>
        <description>ランダムな文字列を生成する

配列を利用


&lt;?php
// 乱数に使用する文字
$strseed = &#039;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&#039;;

// 必要な文字数
$length = 10;

// str_split() は文字列を配列に変換する関数 ( PHP5 )
$array_str = str_split($strseed);

// array_rand() は配列から一つ以上の要素のキーを取得
// 一つだけの時はキーを返し、それ以外はキーの配列を返す
// 
$rand = array_rand($array_str , $length );
// 配列をシャッフルする 
shuffle($rand);

for ($i = 0, $str = null; $i &lt; $length ; $i++) {
	$str .= $array_str[$rand[$i]];
}
echo $str;
?&gt;…</description>
    </item>
    <item rdf:about="http://wiki.rookie-inc.com/development/language/php/snippets/urlencode">
        <dc:format>text/html</dc:format>
        <dc:date>2017-04-14T05:21:33+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>文字列をURLエンコードする</title>
        <link>http://wiki.rookie-inc.com/development/language/php/snippets/urlencode</link>
        <description>文字列をURLエンコードする

urlencode()関数を使用。
概要文字列をURLエンコードする書式string urlencode( string str )
	*  「-_.」を除くすべての英数字以外を「%」に続く2桁の数字に置き換える
	*</description>
    </item>
</rdf:RDF>
