string reading problems
Hello, i try to do something here
if text contains \x then do something and skip text "\x" here is code PHP Code:
sometime it crab a wrong thing, m[23] == '\' , m[24] == '1' , m[25] == '3' and i will got 3 with this code, how is this possible? |
Re: string reading problems
if(contain(m, "/x") != -1)
{ //The string contains /x //this is what we do } |
Re: string reading problems
Quote:
PHP Code:
|
Re: string reading problems
You don't loop it, that is the point. If you need to know where in the string /x is, cache the return of contain and use that. Contain returns the index of where the second argument is. Check out the wiki. then you'd take that index, add 2, and that is the start of w/e you're looking for.
Show the whole function so i know more of what you're trying to do. |
Re: string reading problems
Are you trying to convert \x## from HEX to an ASCII character?
|
Re: string reading problems
Quote:
So what i want to do is "Too much" to talk about it, many systems of mine will use that code. But now on i just try to create code what can do Following things. Sort tag-ed data into the correct string variable. Add x char to all string variable where i sort data except that one what is in progress right now. PHP Code:
I really need to use loop and do every char one by one only then i can get unlimited opportunity, you never know what you need to do next time. Its a big script and all my functions must have unlimited opportunity, ohter ways i will keep writing a code and it will get really too huge. For no own, i dont know that if the size of the all plugin code takes more cpu if many functions is used very rarely, so im trying to keep it safe just for case. Quote:
|
Re: string reading problems
strfind be an option ?
Well if you post whole funcion you will get a better answer. |
Re: string reading problems
show your whole code. No one knows what you're trying to do. Because there are natives that do this better.
|
Re: string reading problems
you could use regex to find \x## from string and use replace() to replace that with empty string
|
Re: string reading problems
**Code removed**
I try one more time to make working code, this is just too badly coded. |
| All times are GMT -4. The time now is 05:41. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.