![]() |
php quik question
what is the function with wich i can see if a string is in other string?
|
You can use substr_count() to count the number of times a given string is found within another.
http://us4.php.net/manual/en/function.substr-count.php |
ereg(), eregi()
|
or preg_match()
|
strstr($string, "string")
find the first occurance of "string" in $string ... this command is pretty useful. in your case... if (strstr($string, "UHH")) { echo "YES.. UHH is in string!" } |
thanks for your reply
i want to make an redirect to another page if a string is in the referer page...i've tryed eregi() and strstr() and both times i get same error this is the code i used: PHP Code:
"Cannot add header information - headers already sent by (output started at /home/..............) " any ideea why i get this error? |
ehm you shouldn't include any html tags there, make it like this.
edit: nevermind this, it's VBulletin adding the html tags even when outputing PHP code. PHP Code:
|
Quote:
|
feel free to use my code
php.hahahahahahahaha%%#)I$)#.PHP! that should take care of ya cheers :glugglug |
All times are GMT -7. The time now is 12:15 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123