Title: Parse error in custom function for Gravity Forms
Last modified: August 21, 2016

---

# Parse error in custom function for Gravity Forms

 *  [rbmg-wp](https://wordpress.org/support/users/rbmg-wp/)
 * (@rbmg-wp)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/parse-error-in-custom-function-for-gravity-forms/)
 * Hello,
 * PHP newbie here. Have tried to write a custom function for use with Gravity Forms.
   Have created a child them and that’s all good.
 * Purpose of function: to take a value from a date picker field and return what
   day of the week it is.
 * Have added this into functions.php and added to child theme:
 *     ```
       <?php
       /**
        * Use Gravity Forms Conditional Logic with Dates
        */Returns day of week of selected date
   
       add_filter("gform_field_value_dayofweek", "liz_populate_dayofweek");
       function liz_populate_dayofweek( $value ){
           $timestamp = (strtotime($value))
           $day = date('l', $timestamp);
           return $day;
       }
       ?>
       ```
   
 * Which gives the following error:
    : syntax error, unexpected T_STRING in …line
   4 of child theme functions.php
 * Can anyone help me out here please?
    Many thanks!!

Viewing 1 replies (of 1 total)

 *  Thread Starter [rbmg-wp](https://wordpress.org/support/users/rbmg-wp/)
 * (@rbmg-wp)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/parse-error-in-custom-function-for-gravity-forms/#post-4195858)
 * NB, I have just noticed the missing semi-colon on line 3 and fixed it but it 
   makes no difference.

Viewing 1 replies (of 1 total)

The topic ‘Parse error in custom function for Gravity Forms’ is closed to new replies.

## Tags

 * [conditional logic](https://wordpress.org/support/topic-tag/conditional-logic/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 1 reply
 * 1 participant
 * Last reply from: [rbmg-wp](https://wordpress.org/support/users/rbmg-wp/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/parse-error-in-custom-function-for-gravity-forms/#post-4195858)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
