PDA

View Full Version : PHP explode array function



azmanar
03-06-2006, 09:27 AM
Hi,

Can anyone person show me an example AMS function that acts like PHP Explode Array function and assign values to variables? I have difficulty in figuring this out in AMS, i.e., reading and extracting delimited values from each line of my text files.

The example PHP function is :
//Values Passed from earlier parsing and delimited by ' - ', or '::' or ';;' or space
$my_data = "Alan-20";

//Extract Data from separator
$data_array = explode ('-', $my_data);

//Assign Extracted Values to variables
$name = $data_array[0];
$age = $data_array[1];

//output
echo "Name : $name , Age : $age";


Please................help.

Thank you.

Worm
03-06-2006, 09:34 AM
In your Gallery in AMS. There is a scriplet named DelimitedStringsFunctions.lua. Take a look in this file for a function named DelimitedStringToTable. I'm sure you'll get it from there, but if you need help, post back.

azmanar
03-06-2006, 01:01 PM
In your Gallery in AMS. There is a scriplet named DelimitedStringsFunctions.lua. Take a look in this file for a function named DelimitedStringToTable. I'm sure you'll get it from there, but if you need help, post back.

Thanks Worm...