I'm creating a web, where I want one part of it to look something like this: Some text, followed by an audio tag with path to the audio file and then an underline(not an underline to text, but line that would separate the content) below that. This then repeats many times.
What I would like to do is to just write the line of text and then maybe write a tag or just leave the line of text. The script would just go thruough all the lines and paste there the audio tag with the filename (which would be just name_of_file*, where * would get by one bigger on each line) and the underline.
What I'm doing now is just pasting the audio tag and an hr tag after each line of text, then going through and manually writing the numbers of the files. And that is just stupid and tidious.
I'm familiar with HTML, CSS, and PHP. But I guess there is probably easier solution to this than to use PHP.
I hope you can understand what I mean and thanks for every answer!
You could get a text editor to do this, but if you already know PHP, I think it's much simpler to use that.
$array=array(
'line of text',
'another line of text',
array('text'=>'This one is special cause it has a tag', 'tag'=>'myTag'),
'yet another line o text',
.....
);
foreach($array as $index=>$val){
if($index>0){
echo '<hr>';
}
if(is_array($val)){
echo $val['text'];
echo 'tag: '.$val['tag'];
}else{
echo $val;
}
echo '<audio src="whatever_'.$index.'.oog">..put some <source> here...</audio>';
}