0

I have a form

Name : (input name="detail[name])...in a form

Address : (input name="detail[address])...in a form

Username : (input name="detail[username])...in a form

Now using php I fetched the data as

$values = array();    
$values = array_map('ucwords', $_POST['detail']);

Here, $values is an array and the data submitted from the form has been manipulated by changing the first letter of each word into caps ... since I incorporated array_map and ucwords

Now what I wanna do is ... I don't want username to be affected with that ucwords function ... suppose if the user types "heNDriX" as username ... I want the same to be dumped in database ...

So please help me guys

Thanks in advance :D

1 Answer 1

1

If you just have one exception, you can just overwrite your values array with the value in $_POST['detail']['username']

$values = array();
$values = array_map('ucwords', $_POST['detail']);
$values['username'] = $_POST['detail']['username'];
Sign up to request clarification or add additional context in comments.

1 Comment

actually i got an array within an array so ... array_map('ucwords', $string) is not working ... how to apply such for an array within an array

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.