/    Sign up×
Community /Pin to ProfileBookmark

strtolower() POSTed string

I’m stumped as to why strtolower() works sometimes in this instance and sometimes not.

[code=php]
if(isset($_POST[‘auto_submit’])){
$Spost = $_POST[‘start’];
$Fpost = $_POST[‘finish’];
$Spost = strtolower($Spost);
$Fpost = strtolower($Fpost);
$MonNames = array(“jan”, “feb”, “mar”, “apr”, “may”, “jun”, “jul”, “aug”, “sep”, “oct”, “nov”, “dec”);
$MonNums = array(“01”, “02”, “03”, “04”, “05”, “06”, “07”, “08”, “09”, “10”, “11”, “12”);
$Spost = str_replace($MonNames, $MonNums, “$Spost”);
$Fpost = str_replace($MonNames, $MonNums, “$Fpost”);

[/code]

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@kurbyJun 25.2009 — Did you try the str_replace without the quotes around $Spost?

[code=php]$Spost = str_replace($MonNames, $MonNums, $Spost);
$Fpost = str_replace($MonNames, $MonNums, $Fpost); [/code]


Perhaps some examples of it working and not working will shed some more light on the situation.
Copy linkTweet thisAlerts:
@bustyaauthorJun 25.2009 — I believe that did the trick, still testing, silly me.

Issues arose when entered "mAY" and "maY" sometimes.
×

Success!

Help @bustya spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...