hey jongens, ik heb een aantal php vragen voor mijn nieuwe systeem.
1. Ik heb $file. daarin kan staat "hoofd" maar ook "HOOFD". Ik wil alle "HOOFD" vervangen door "hoofd".
wat ik heb:
En dan wil van een url (http://www.one2xs.com) maken -> one2xs
wat ik heb:
1. Ik heb $file. daarin kan staat "hoofd" maar ook "HOOFD". Ik wil alle "HOOFD" vervangen door "hoofd".
wat ik heb:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/str_replace"]str_replace[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR] [COLOR= #DD0000]HOOFD[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]TITLE[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]NAME[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]AUTHOR[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]CONTENT[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]ROBOTS[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]WEB[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]CENTER[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]TABLE[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]BORDOR[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]WIDTH[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]FONT[/COLOR][COLOR= #007700]),[/COLOR]
[URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR] [COLOR= #DD0000]hoofd[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]title[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]name[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]author[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]content[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]robots[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]web[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]center[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]table[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]bordor[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]width[/COLOR][COLOR= #007700],[/COLOR]
[COLOR= #DD0000]font[/COLOR][COLOR= #007700]),[/COLOR] [COLOR= #0000BB]$file[/COLOR][COLOR= #007700]);[/COLOR]
?> En dan wil van een url (http://www.one2xs.com) maken -> one2xs
wat ik heb:
[COLOR= #0000BB]<?php
$url[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]url[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/str_replace"]str_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]www.[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$url[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/preg_match"]preg_match[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]~http://(.*?).~[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$url[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$naam[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$naam[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$naam[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$naam[/COLOR][COLOR= #007700];[/COLOR]
?> 