# Strange string validation problem with Flash/PHP

**URL:** <https://forum.kirupa.com/t/strange-string-validation-problem-with-flash-php/242466>\
**Category:** programming\
**Created:** [October 26, 2007, 9:13am UTC](https://forum.kirupa.com/t/strange-string-validation-problem-with-flash-php/242466 "2007-10-26T09:13:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qgeis](https://avatars.discourse-cdn.com/v4/letter/q/76d3ee/32.png) [@Qgeis](https://forum.kirupa.com/u/Qgeis)\
**Post date:** [October 26, 2007, 9:13am UTC](https://forum.kirupa.com/t/strange-string-validation-problem-with-flash-php/242466/1 "2007-10-26T09:13:49Z")

</div>

I’m outputting a “+” delimied string from flash (loadVars) to PHP

[COLOR=RoyalBlue] **1+3+5+13+45** [/COLOR]

I’m using regex to test if the string is valid. Using [regexlib.com](http://regexlib.com) tester.

\*\*[COLOR=RoyalBlue]Regex pattern: ^[0-9+]+$

1 (Match)  
[/COLOR]**[COLOR=RoyalBlue]1+3+5+13+45[/COLOR]**[COLOR=RoyalBlue] (Match)  
1+ (Match)[/COLOR]\*\*

This is part of my PHP code.

```php

$this->data = array('Enquiry' => array(
            'name' => $_POST['fname'],
            'from' => $_POST['femail'],
            'address' => $_POST['faddress'],
            'tel' => $_POST['ftel'],
            'remarks' => $_POST['fremarks'],
            'wedding_date' => $_POST['fyyyy'].'-'.$_POST['fmm'].'-'.$_POST['fdd'],
            'gowns' => $_POST['savedGowns'],
            'sent' => 0
        ));

if (!preg_match('/^[0-9\+]+$/', $this->data['Enquiry']['gowns'])){
            $ok = false;
            $error = 'Invalid gown list';
        }

```

It keeps telling me that the string is invalid even though it is. The string I output to PHP is absolutely valid COLOR=black[/COLOR]. So I suspect could the string have become encoded when it goes into php or something? Like the “+” chars becomes something else?
