Jump to content

TwiztedCupid

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

TwiztedCupid's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Not 100% on this one but you can try... $endings = array("\n--\n==================================================================\nthis mobile text message is brought to you by at&t", "blue", "green"); $replace_text= "\n--\n==================================================================\nthis mobile text message is brought to you by at&t"; $replacement = ""; for($i=0;$i<count($endings);$i++) { if($endings[$i] == $replace_text) { $endings[$i] = $replacement; } } print_r($endings); This will find that text and remove it where ever it is in your array. It will however leave a blank spot in your array. I added "blue" and "green" to show what would happen if you added more stuff to the array. OUTPUT: Array ( [0] => [1] => blue [2] => green ) Or you can try..... $endings = array("\n--\n==================================================================\nthis mobile text message is brought to you by at&t", "blue" , "green"); unset($endings[0]); print_r($endings); This will remove the first entry in the array. If your red text is always in that position then this should also work. OUTPUT: Array ( [1] => blue [2] => green )
  2. Another noob question here. I've got a form that I use to collect info for an estimate. I also am using Developer toolbox from Adobe. Makes my life a lot easier, but doesn't teach you anything. lol Originally I had a drop down box that would hold the value of selected item and post it into to emailTO field. Which worked just fine. Example: //This is my array. $emails_array = array( 'Landscape Maintenance'=>'[email protected]', 'Landscape Design'=>'[email protected]', 'Planting Renovation'=>'[email protected]', 'Tree Service'=>'[email protected]', 'Weed Man Lawn Fertilization'=>'[email protected]', 'Snowplowing'=>'[email protected]', 'Other'=>'[email protected]'); //This grabs the post of the drop down box and inserts the email addy. $emailObj->setTo($emails_array[$_POST['Services']]); Now I have to change the drop down box to a check box group. In which the user can select multiple services and have multiple email sent out if necessary. This is where I'm stuck. I need to get the post values compare the results to the key in $emails_array then spit out the email associated with it. Here's what I got so far. $postresult = $_POST['services']; echo 'Postresult: ' . "$postresult" . "<br />"; $myarray = explode(",", $postresult); echo 'Dirty Array: '; print_r($myarray); Here are the results Postresult: Landscape Maintenance,Tree Service,Snowplowing<br> MyArray: Array ( [0] => Landscape Maintenance [1] => Tree Service [2] => Snowplowing ) How do I take either $postresult OR $myarray and compare it to $emails_array and get the unique email values for it? I want to maintain the original $postreault so i can insert it into a mysql db. Here is the code Developer toolbox produces for the checkbox group. <form method="post"> <label> <input type="submit" name="Submit" id="Submit" value="Submit"> <input name="services" id="services" wdg:recordset="Recordset1" wdg:subtype="CommaCheckboxes" wdg:type="widget" wdg:displayfield="service" wdg:valuefield="service" wdg:groupby="2" style="display: none; "><span><table cellpading="0" cellspacing="0" border="0"><tbody><tr><td><label id="services_label0" htmlfor="services_commacheckbox0" for="services_commacheckbox0"><input type="checkbox" id="services_commacheckbox0" value="Landscape Maintenance" cbFor="services">Landscape Maintenance</label></td><td><label id="services_label1" htmlfor="services_commacheckbox1" for="services_commacheckbox1"><input type="checkbox" id="services_commacheckbox1" value="Landscape Design" cbFor="services">Landscape Design</label></td></tr><tr><td><label id="services_label2" htmlfor="services_commacheckbox2" for="services_commacheckbox2"><input type="checkbox" id="services_commacheckbox2" value="Planting Renovation" cbFor="services">Planting Renovation</label></td><td><label id="services_label3" htmlfor="services_commacheckbox3" for="services_commacheckbox3"><input type="checkbox" id="services_commacheckbox3" value="Tree Service" cbFor="services">Tree Service</label></td></tr><tr><td><label id="services_label4" htmlfor="services_commacheckbox4" for="services_commacheckbox4"><input type="checkbox" id="services_commacheckbox4" value="Weed Man Lawn Fertilization" cbFor="services">Weed Man Lawn Fertilization</label></td><td><label id="services_label5" htmlfor="services_commacheckbox5" for="services_commacheckbox5"><input type="checkbox" id="services_commacheckbox5" value="Snowplowing" cbFor="services">Snowplowing</label></td></tr><tr><td><label id="services_label6" htmlfor="services_commacheckbox6" for="services_commacheckbox6"><input type="checkbox" id="services_commacheckbox6" value="Other" cbFor="services">Other</label></td><td colspan="2"> </td></tr></tbody></table></span> </label> </form> I would appreciate any help on this. thank you.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.