Kleine Vragen Topic #1

Gestart doorLennard4.284 reacties15.585 weergaven

4.285 berichten · pagina 232 van 286

Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik ben met XML aan het werken, en ik probeer een Cache bestandje te maken om mee te testen.

Nu heb ik een stuk code (in een class). Maar hij doet het niet echt. Ik probeer het van uit een array te genereren.

Code:
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/*
 *     @author:        Marijn Kok
 *  @date:            17 Jan 2013
 *  @description:    A own make test cache, to test for some info.
 */[/COLOR]

[URL="http://www.php.net/class"]class[/URL] xmlCache [COLOR= #007700]{[/COLOR]
    
    [URL="http://www.php.net/public"]public[/URL] [COLOR= #007700]function[/COLOR] makeCache[COLOR= #007700]([/COLOR][COLOR= #0000BB]$array[/COLOR][COLOR= #007700]) {[/COLOR]
        [COLOR= #0000BB]$xml[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"<?xml version="1.0" encoding="UTF-8"?>rn"[/COLOR][COLOR= #007700];[/COLOR]
        [COLOR= #0000BB]$xml[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]"<tests>"[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]<[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$array[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++) {[/COLOR]
            
            [COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"test"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$xml[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]"t<test="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$array[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"> rn"[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$xml[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]"tt<head>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$array[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]testHead[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</head> rn"[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$xml[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]"tt<author>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$array[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]testAuthor[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</author> rn"[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$xml[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]"tt<content>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$array[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]testContent[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</content> rn"[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$xml[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]"t</test>"[/COLOR][COLOR= #007700];            
        }[/COLOR]
        [COLOR= #0000BB]$xml[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]"</tests>"[/COLOR][COLOR= #007700];[/COLOR]

        [COLOR= #0000BB]$file[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"cache.xml"[/COLOR][COLOR= #007700];[/COLOR]
        file_put_contents[COLOR= #007700]([/COLOR][COLOR= #0000BB]$file[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$xml[/COLOR][COLOR= #007700],[/COLOR] LOCK_EX[COLOR= #007700]);
    }
}[/COLOR]

[COLOR= #0000BB]$cache[/COLOR] [COLOR= #007700]= new[/COLOR] xmlCache[COLOR= #007700];[/COLOR]

[COLOR= #0000BB]$aTest[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR]
            [COLOR= #DD0000]test1[/COLOR] [COLOR= #007700]=>[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR]
                        [COLOR= #DD0000]testHead[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]First heading[/COLOR][COLOR= #007700],[/COLOR] 
                        [COLOR= #DD0000]testAuthor[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]Marijn Kok[/COLOR][COLOR= #007700],[/COLOR]
                        [COLOR= #DD0000]testContent[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]This is the first test message[/COLOR]
                    [COLOR= #007700]),[/COLOR]
            [COLOR= #DD0000]test2[/COLOR] [COLOR= #007700]=>[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR]
                    [COLOR= #DD0000]testHead[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]second heading[/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000]testAuthor[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]John Doe[/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000]testContent[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]This is the Second test message[/COLOR]
                    [COLOR= #007700]),[/COLOR]
            [COLOR= #DD0000]test3[/COLOR] [COLOR= #007700]=>[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR]
                    [COLOR= #DD0000]testHead[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]Third heading[/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000]testAuthor[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]Deriksons jansen[/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000]testContent[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]This is the Third test message[/COLOR]
            [COLOR= #007700]),[/COLOR]
            [COLOR= #DD0000]test4[/COLOR] [COLOR= #007700]=>[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR]
                    [COLOR= #DD0000]testHead[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]Last heading[/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000]testAuthor[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]Marijn Kok[/COLOR][COLOR= #007700],[/COLOR]
                    [COLOR= #DD0000]testContent[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]This is the most awesome test message[/COLOR]
            [COLOR= #007700])
        );[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cache[/COLOR][COLOR= #007700]])) {[/COLOR]
    [COLOR= #0000BB]$cache[/COLOR][COLOR= #007700]->[/COLOR]makeCache[COLOR= #007700]([/COLOR][COLOR= #0000BB]$aTest[/COLOR][COLOR= #007700]);
}[/COLOR]
?>
<form method="POST">
    <input type="submit" name="cache" />
</form>
Kan iemand mij helpen hier mee?
Alvast bedankt.
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
En wat gebeurt er wel? Met iets als : "Hij werkt niet!", kunnen we niks.
0
Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik krijg: Notice: Undefined index: test0 in C:xampphtdocsapiapiindex.php on line 16, alleen dat word steeds groter. Tot oneindig.

toevoeging op 18 januari 2013, 14:49:35:
Ik krijg nu deze error: Notice: Array to string conversion in C:xampphtdocsapiapiindex.php on line 15

En ik krijg de error maar 4keer, wat al een verbetering is, omdat de for lus zich 4x moet herhalen.
0
Berichten
3.037
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wie kan dit voor me regelen:

1 Normale minecraft button (zonder tekst)
1 Hover minecraft button (zonder tekst)
1 Geblokkeerde/donkere minecraft button (zonder tekst)

Als afbeelding, kleine vergoeding aanwezig!
Stuur een PM met de buttons

toevoeging op 18 januari 2013, 17:32:24:
Niemand? sadley
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Videotube schreef:
Wie kan dit voor me regelen:

1 Normale minecraft button (zonder tekst)
1 Hover minecraft button (zonder tekst)
1 Geblokkeerde/donkere minecraft button (zonder tekst)

Als afbeelding, kleine vergoeding aanwezig!
Stuur een PM met de buttons
toevoeging op 18 januari 2013, 17:32:24:
Niemand? sadley
Ga toch eens naar aanvragen
0
Berichten
11.263
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wat vinden jullie een goede indeling voor een layout over heel het scherm?
Voor een bedrijf?
0
Lennard

Lid · Topicstarter

Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Sanderc schreef:
Wat vinden jullie een goede indeling voor een layout over heel het scherm?
Voor een bedrijf?
Layouts over het hele scherm vind ik nooit zo mooi sadley ken weinig sites die dat hebben en mooie layout hebben
0
Berichten
4.214
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Een class gebruiken in een andere class zonder singleton of opnieuw aan te roepen, is dat mogelijk?
0
Thom

Lid

Berichten
10.654
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Weet iemand een goede Wordpress theme tutorial?
0
Berichten
2.363
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Thommity schreef:
Weet iemand een goede Wordpress theme tutorial?
Je zou eens hier kunnen kijken, is een 4-delige serie over het maken van WP-Themes.

Mocht je een goed voorbeeld willen van hoe een thema in elkaar zit is bones handig. Misschien wat uitgebreid voor je eerste thema, maar het beviel mij goed.
0
Thom

Lid

Berichten
10.654
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dweazel schreef:
Eerdere citaten tonen
Thommity schreef:
Weet iemand een goede Wordpress theme tutorial?
Je zou eens hier kunnen kijken, is een 4-delige serie over het maken van WP-Themes.

Mocht je een goed voorbeeld willen van hoe een thema in elkaar zit is bones handig. Misschien wat uitgebreid voor je eerste thema, maar het beviel mij goed.
Thanks
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Thommity schreef:
Eerdere citaten tonen
Sevvlor schreef:
http://www.industrialgaming.net/ is die shoutbox een yay of een nay
nay
tipjes? -bullshit, ik sluit notepad weer emo-
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren