Results 1 to 3 of 3
Hybrid View
-
14th Dec 2010, 10:27 PM #1OPMemberWebsite's:
UsersTracking.com WhatIsNanoSim.com TVShowsBB.com WhatIsSurfaceTablet.com WhatIsLoan.netHelp with Regex
Hi,
I have youtubetomp3 site, www.YoutubeToMP3.me,
Now I have problem with videos that contain unusual chars, likePHP Code:";,/
Here is the 2 functions that Saved the name from youtube:
PHP Code:function ExtractSongTrackName($vidSrc, $srcType)
{
$name = '';
$vidSrcTypes = $this->GetVidSrcTypes();
if (in_array($srcType, $vidSrcTypes))
{
$vidSrc = ($srcType == $vidSrcTypes[1]) ? file_get_contents($vidSrc) : $vidSrc;
if ($vidSrc !== false && eregi('eow-title',$vidSrc))
{
$name = end(explode('eow-title',$vidSrc));
$name = current(explode('">',$name));
$name = end(explode('title="',$name));
}
}
return $name;
}
PHP Code:private function SetSongFileName($file_contents)
{
$vidSrcTypes = $this->GetVidSrcTypes();
$trackName = $this->ExtractSongTrackName($file_contents, $vidSrcTypes[0]);
return $this->_songFileName = (!empty($trackName)) ? self::_SONGFILEDIR . preg_replace('/_{2,}/','_',preg_replace('/ /','_',preg_replace('/^[A-Za-z0-9]+$/','',$trackName))) . '.mp3' : '';
}
Regards.ChaoscripT Reviewed by ChaoscripT on . Help with Regex Hi, I have youtubetomp3 site, www.YoutubeToMP3.me, Now I have problem with videos that contain unusual chars, like ";,/ etc. Here is the 2 functions that Saved the name from youtube: function ExtractSongTrackName($vidSrc, $srcType) { $name = ''; $vidSrcTypes = $this->GetVidSrcTypes(); if (in_array($srcType, $vidSrcTypes)) { Rating: 5Nano Sim Cutter | TVShowsBB.com | UsersTracking.com - Online Visitor Counter
WhatIsSurfaceTablet.com | What Is Loan
-
15th Dec 2010, 09:24 PM #2Member
What exactly is your problem?
If you want to apply RegEx to them, you can escape the chars with a backslash (if needed).
-
15th Dec 2010, 09:26 PM #3OPMemberWebsite's:
UsersTracking.com WhatIsNanoSim.com TVShowsBB.com WhatIsSurfaceTablet.com WhatIsLoan.netI want that the songs names will be in the same like youtube name.
But I have problem with unusual chars, How I can delete them or something?
I also wants that it'll worked with Hebrew language.
Regards.Nano Sim Cutter | TVShowsBB.com | UsersTracking.com - Online Visitor Counter
WhatIsSurfaceTablet.com | What Is Loan
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Regex in shell
By mahjong in forum Server ManagementReplies: 0Last Post: 8th Apr 2012, 08:58 AM -
Need help with RegEx
By dima1236 in forum Web Development AreaReplies: 7Last Post: 14th Jan 2012, 05:53 PM -
Need help with Regex - VB.NET
By Connor in forum Web Development AreaReplies: 2Last Post: 27th Sep 2011, 05:11 PM -
php help regex!
By ?RaJ? in forum Technical Help Desk SupportReplies: 7Last Post: 26th Apr 2011, 09:22 PM -
need help with some regex
By t3od0r in forum Web Development AreaReplies: 1Last Post: 13th Aug 2010, 04:23 PM
themaLeecher - leech and manage...
Version 5.02 released. Open older version (or...