ManiacDan
Staff Alumni-
Posts
2,604 -
Joined
-
Last visited
-
Days Won
10
Everything posted by ManiacDan
-
It depends on the input and the way the users want the output to be. I was assuming, based on the OP's post, that the users were inputting various strings which would be spit out INSIDE of HTML, rather than the users inputting HTML which would then be output and expected to be formatted. If it's the latter, then no encoding at all is necessary. I bet it's the former though, otherwise misplaced unescaped quotes wouldn't be a problem.
-
Create a php file like an ASP.Net *.dll file?
ManiacDan replied to tinwakr's topic in Other Libraries
Generally that's how it works when the code is obfuscated. I don't the particulars of ioncube itself, their documentation would explain for sure. -
Create a php file like an ASP.Net *.dll file?
ManiacDan replied to tinwakr's topic in Other Libraries
Nothing changes in the way you use it, it just becomes difficult for a human to read it and edit it. -
$b in my example is already a timestamp.
-
If we saw all your code and you told us the reason behind it, I'm sure we could figure out a way to utilize arrays properly and pare the size down a lot. However, if it's working it's working.
-
In addition, this whole thing could have been worked around with an IF statement without any ill effects on your code. In fact, I bet the IF solution is a little faster than array_filter.
-
Ok, really, date() can output a date in any format you want. Check the manual page.
-
Exactly what I posted above, except replace 'c' with 'A'
-
Indeed I did, which is why I suggested the html function.
-
Create a php file like an ASP.Net *.dll file?
ManiacDan replied to tinwakr's topic in Other Libraries
The best way to do that is through ioncube or something similar. or simply through a legal agreement with the customer. -
Definitely not addslashes, that hasn't been recommended for years. If you're trying to include content inside of HTML tags, you should use the htmlentities() function.
-
Create a php file like an ASP.Net *.dll file?
ManiacDan replied to tinwakr's topic in Other Libraries
Why do you want this? Describe the problem you're trying to solve. -
Yes, obviously, so what you're saying is: "I have three numbers: 4, 9, 18. I want to find the minimum of these numbers, but I don't want to count the middle one, so how do I make it infinite?" Don't include it, and it can't possibly be the min...because it's not included. Call the function without that variable, and it can't possibly be the answer. What am I missing here?
-
Remove everything from a string after the third slash
ManiacDan replied to Mcod's topic in Regex Help
Josh's way is faster than mine, but he trims the trailing slash. You'll have to re-add it. -
Whoever told you to use magic_quotes or addslashes is wrong, or at least they stopped being right in 2003 when we moved to mysql_real_escape_string. I don't know where the carat is coming from though.
-
Remove everything from a string after the third slash
ManiacDan replied to Mcod's topic in Regex Help
Neither of the above will handle your second case. You want: echo preg_replace('#^(.*?/.*?/.*?/).*$#', "\\1", $yourString); -Dan -
1) You don't need the array declaration in there, min() supports an infinite number of arguments. 2) Simply remove $maq entirely. You're asking "I want the minimum of two numbers, or infinity." Infinity is never the minimum of any set, just remove it.
-
Then you have magic quotes turned on, check your php.ini Your slash has been backward in both of your examples so far. Is it really /' or is is \' ?
-
What problem are you attempting to solve here?
-
Don't use stripslashes or addslashes, and make sure magic_quotes is OFF. use mysql_real_escape_string on your INSERT statements only. Don't do anything when you retrieve the data.
-
Ok, it might help if someone else says it: You cannot know what "too long" means in PHP. You can't. Look: WWWWWWWWWW <-- 10 Ws IIIIIIIIII <-- 10 Is See how those are drastically different widths? Now, a CSS way is really the only good way to do this because the browser will know how wide the text it's drawing will be, and the browser can then determine line breaks and line height, both of which can be specified by CSS.
-
Vanished Out of the Google Search Rankings for Quite Some Time
ManiacDan replied to Glese's topic in Miscellaneous
Google weights new sites more heavily than old. Release an update, redesign the site, do something to trigger the "new" flag. -
$a = '03-03-2008, 08:26 PM'; list($date, $time) = explode(', ', $a); list($month, $day, $year) = explode('-', $date); $b = strtotime("{$year}-{$month}-{$day} {$time}"); echo date('c', $b); //2008-03-03T20:26:00-05:00 -Dan
-
You can't edit your post more than 30 seconds after you post it. It's one of the forum rules. The OP needs a lot more than just PHP GET functionality. None of his queries are even being run.
-
setlocale changes the output of many functions, including date related functions. -Dan