Feeds Tamper PHP provides a small and simple plugin to execute PHP code and modify data before it gets saved.
How to use Feeds Tamper PHP
- Install Feeds, Feeds Tamper and Feeds Tamper PHP
- Create and configure a feed importer
- In your feed importer add an "Execute php code" plugin
- Write your own php code and return modified data. You have two variables: $field (containing the field value) and $item (containing all values of the item being imported).
e.g. if you're importing a CSV file with fields named "Field1" and "Field2", the corresponding values for each line will be available in $item['field1'] and $item['field2']. (Please note that keys in $item are always lowercase!)
A Drupal 8 version will be developed when Feeds and Feeds Tamper will have their stable versions.
Before posting any issue, please, be sure you have a very good understanding of Feeds and Feeds Tamper.