通过php向flash对象添加一些参数
我有一个挑战,我提交的数据与flash对象youtube视频 我想查看这个数据的字符串,看看是否有一个对象,然后b1在对象内部添加一些参数,2在嵌入中添加相同的属性 到目前为止我已经通过php向flash对象添加一些参数,php,Php,我有一个挑战,我提交的数据与flash对象youtube视频 我想查看这个数据的字符串,看看是否有一个对象,然后b1在对象内部添加一些参数,2在嵌入中添加相同的属性 到目前为止我已经 // check if the content contains a youtube video... and that it doesn't have the opaque wmode if(strstr($content, '<object') && strstr($content
// check if the content contains a youtube video... and that it doesn't have the opaque wmode
if(strstr($content, '<object') && strstr($content != 'wmode="opaque"')) {
// split the string after the object tag, and insert the <param tag
// find the occurance of the <embed tag and insert the attribute
}
然后我意识到,如果数据在$content字符串中包含2个或更多的对象,那么会发生什么呢?因此,解决方案需要对$content变量中的每个对象使用某种循环函数
我想我需要
计算变量中存在对象的次数。
循环遍历每一个,并为每一个eek执行上述代码
我的做法正确吗?您认为什么是最好的解决方案?尝试以下方法:
if(preg_match_all('/<object(.*?)<\/object>/', $content, $matches)) {
print_r ($matches);
}