How do I get the tag value of option with php?

<form action="" method="post">
<select name="Color">
<option value="Red">myRed</option>
<option value="Green">myGreen</option>
<option value="Blue">myBlue</option>
<option value="Pink">myPink</option>
<option value="Yellow">myYellow</option>
</select>
<input type="submit" name="submit" value="Get Selected Values" />
</form>

<?php
if(! empty($_POST["submit"])){
$selected_val = $_POST["Color"];  
echo "You have selected :    " .$selected_val; 
}

  myPink

click

You have selected : Pink

what I need now is to display the value of the tag corresponding to the option I selected, that is,
wants to output
You have selected: myPink

excuse me, is there any php available to do this?

Apr.09,2021

1. Change the value of option to the same value as the name
2. Or concatenate the postvalue in php my

is purely a foolish opinion, for reference only


agree with the other answer.

or you can add a hidden form to form. The value is the value of the tag you mentioned (of course, it needs to be changed dynamically by js listening), and then you can upload it together when you post.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4c986-4c5cf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4c986-4c5cf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?