<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>takoblog von takomat :: Neue Lebensformen für Medien &#187; PHP-Schnippsel</title>
	<atom:link href="http://blog.takomat.com/category/php/php-code-schnippsel/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.takomat.com</link>
	<description></description>
	<lastBuildDate>Mon, 26 Jul 2010 14:55:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>PHP: Umlaute in HEX-Code umwandeln</title>
		<link>http://blog.takomat.com/php/php-umlaute-in-hex-code-umwandeln.html</link>
		<comments>http://blog.takomat.com/php/php-umlaute-in-hex-code-umwandeln.html#comments</comments>
		<pubDate>Sun, 02 Nov 2008 14:20:56 +0000</pubDate>
		<dc:creator>Marcin Jakubowski</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP-Schnippsel]]></category>
		<category><![CDATA[Code-Schnippsel]]></category>
		<category><![CDATA[HEX-Code]]></category>

		<guid isPermaLink="false">http://blog.takomat.com/?p=67</guid>
		<description><![CDATA[Hier ist eine kleine Funktion, mit der man Umlaute in HEX-Code umwandeln kann. PHP-code: function strip_umlaute&#40;$wert&#41;&#123; &#160; $umlaute = Array&#40;&#34;/ä/&#34;,&#34;/ö/&#34;,&#34;/ü/&#34;,&#34;/Ä/&#34;,&#34;/Ö/&#34;,&#34;/Ü/&#34;,&#34;/ß/&#34;&#41;; $replace = Array&#40;&#34;&#38;amp;auml;&#34;,&#34;&#38;amp;ouml;&#34;,&#34;&#38;amp;uuml;&#34;,&#34;&#38;amp;Auml;&#34;,&#34;&#38;amp;Ouml;&#34;,&#34;&#38;amp;Uuml;&#34;,&#34;&#38;amp;szlig;&#34;&#41;; $wert = preg_replace&#40;$umlaute, $replace, $wert&#41;; &#160; return $wert; &#125;]]></description>
			<content:encoded><![CDATA[<p>Hier ist eine kleine Funktion, mit der man Umlaute in HEX-Code umwandeln kann.<br />
<span id="more-67"></span><br />
<strong>PHP-code:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> strip_umlaute<span style="color: #009900;">&#40;</span><span style="color: #000088;">$wert</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000088;">$umlaute</span> <span style="color: #339933;">=</span> <span style="color: #990000;">Array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/ä/&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;/ö/&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;/ü/&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;/Ä/&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;/Ö/&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;/Ü/&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;/ß/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$replace</span> <span style="color: #339933;">=</span> <span style="color: #990000;">Array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;amp;auml;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&amp;amp;ouml;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&amp;amp;uuml;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&amp;amp;Auml;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&amp;amp;Ouml;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&amp;amp;Uuml;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&amp;amp;szlig;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$wert</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$umlaute</span><span style="color: #339933;">,</span> <span style="color: #000088;">$replace</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wert</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$wert</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.takomat.com/php/php-umlaute-in-hex-code-umwandeln.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Zeilenfarbe abwechselnd anzeigen</title>
		<link>http://blog.takomat.com/php/php-zeilenfarbe-abwechselnd-anzeigen.html</link>
		<comments>http://blog.takomat.com/php/php-zeilenfarbe-abwechselnd-anzeigen.html#comments</comments>
		<pubDate>Thu, 16 Oct 2008 14:19:02 +0000</pubDate>
		<dc:creator>Marcin Jakubowski</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP-Schnippsel]]></category>
		<category><![CDATA[Code-Schnippsel]]></category>

		<guid isPermaLink="false">http://blog.takomat.com/?p=65</guid>
		<description><![CDATA[Es ist immer gut, wenn Zeilen von Tabellenlisten im Wechsel unterschiedliche Zeilenfarben haben, um eine bessere Leserlichkeit und Übersicht zu gewährleisten. Wenn die Tabellen-Daten aus einer Datenbank kommen können sie einfach mit dem folgenden kleinen Script erstellt werden: PHP-code: 1 2 3 4 5 6 7 8 for&#40;$count=0;$count&#60;10;$count++&#41; &#123; &#160; if&#40;$count % 2&#41; &#123; $farbe=&#34;#fff&#34;; [...]]]></description>
			<content:encoded><![CDATA[<p>Es ist immer gut, wenn Zeilen von Tabellenlisten im Wechsel unterschiedliche Zeilenfarben haben, um eine bessere Leserlichkeit und Übersicht zu gewährleisten.</p>
<p>Wenn die Tabellen-Daten aus einer Datenbank kommen können sie einfach mit dem folgenden kleinen Script erstellt werden:<br />
<span id="more-65"></span><br />
<strong>PHP-code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000088;">$count</span><span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span><span style="color: #000088;">$count</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$farbe</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#fff&quot;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$farbe</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#ccc&quot;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> 
&nbsp;
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;die gewünschte Frabe ist: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$farbe</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.takomat.com/php/php-zeilenfarbe-abwechselnd-anzeigen.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Datumsanzeige mit Wochentag und Monat</title>
		<link>http://blog.takomat.com/php/php-datumsanzeige-mit-wochentag-und-monat.html</link>
		<comments>http://blog.takomat.com/php/php-datumsanzeige-mit-wochentag-und-monat.html#comments</comments>
		<pubDate>Mon, 13 Oct 2008 11:13:01 +0000</pubDate>
		<dc:creator>Marcin Jakubowski</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP-Schnippsel]]></category>
		<category><![CDATA[Code-Schnippsel]]></category>

		<guid isPermaLink="false">http://blog.takomat.com/?p=62</guid>
		<description><![CDATA[Mit dieser PHP-Funktion ist es möglich ein “YYYY-MM-DD” Datum in verschiedene Datumsformate umzuwandeln. Dabei ist es auch möglich sich Wochentag und Monat ausgeschrieben ausgeben zu lassen: PHP-code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 [...]]]></description>
			<content:encoded><![CDATA[<p>Mit dieser PHP-Funktion ist es möglich ein “YYYY-MM-DD” Datum in verschiedene Datumsformate umzuwandeln. Dabei ist es auch möglich sich Wochentag und Monat ausgeschrieben ausgeben zu lassen:<br />
<span id="more-62"></span><br />
<strong>PHP-code</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> datumformat<span style="color: #009900;">&#40;</span><span style="color: #000088;">$datum</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$jahr</span><span style="color: #339933;">,</span><span style="color: #000088;">$monat</span><span style="color: #339933;">,</span><span style="color: #000088;">$tag</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$datum</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$monate</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">&quot;01&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Januar&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;02&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Februar&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;03&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;März&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;04&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;April&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;05&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Mai&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;06&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Juni&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;07&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Juli&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;08&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;August&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;09&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;September&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;10&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Oktober&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;11&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;November&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;12&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Dezember&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$monat01</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$monate</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$monat</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$tage</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">&quot;Sunday&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Sonntag&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;Monday&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Montag&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;Tuesday&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Dienstag&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;Wednesday&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Mittwoch&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;Thursday&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Donnerstag&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;Friday&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Freitag&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;Saturday&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Samstag&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$wochentag</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;l&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">mktime</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$monat</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tag</span><span style="color: #339933;">,</span> <span style="color: #000088;">$jahr</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$wochentag</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$tage</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$wochentag</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$tag</span>. <span style="color: #006699; font-weight: bold;">$monat01</span> <span style="color: #006699; font-weight: bold;">$jahr</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Format: Tag. Monat Jahr</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;2&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$wochentag</span>, <span style="color: #006699; font-weight: bold;">$tag</span>. <span style="color: #006699; font-weight: bold;">$monat01</span> <span style="color: #006699; font-weight: bold;">$jahr</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Format: Wochentag, Tag. Monat Jahr</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;3&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$tag</span>.<span style="color: #006699; font-weight: bold;">$monat</span>.<span style="color: #006699; font-weight: bold;">$jahr</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Format: TT.MM.JJJJ</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Man ruft die Funkion mit “< ?PHP echo datumformat($datum, $format); ?>” ab. Das Datum muss im Format “YYYY-MM-DD” vorliegen und als zweites wählt man das Format aus (1;2;3).</p>
<p>Das Script ist noch ausbau- und anpassungsfähig. Es lassen sich auch leicht andere Formatierungen zusammenstellen. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.takomat.com/php/php-datumsanzeige-mit-wochentag-und-monat.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
