Search Results

Search found 4 results on 1 pages for 'casben79'.

Page 1/1 | 1 

  • Basic regexp help

    - by casben79
    I am new to programming PHP and am trying to validate a field in a form. The field if for a RAL color code and so would look something like : RAL 1001. so the letters RAL and then 4 numbers. Can someone help me set them into a regular expression to validate them. i have tried this with no success: $string_exp = "/^[RAL][0-9 .-]+$/i"; What can I say but sorry for being a complete NOOB at PHP. Cheers Ben

    Read the article

  • Yet another php ereg fix

    - by casben79
    I have a small chunk of coding I need to take from ereg to preg_match. Here is the code. function be_file_list($d, $x) { foreach (array_diff(scandir($d), array('.', '..')) as $f) { if (is_file($d . '/' . $f) && (($x) ? ereg($x.'$',$f) : 1)) { $l[] = $f; } } return $l; } This code works as expected even if it doesn't look too pretty (source: http://www.php.net/manual/en/function.scandir.php) but as ereg is deprecated, I would really like to make it preg_match, or something like that. I have been messing with this all afternoon and the PC is about to go out the window. I would have thought that preg_match("/"$x.'$',$f"/") would have worked but no dice. Any help would be great. Cheers Ben

    Read the article

  • WordPress Problem with enqueing a script

    - by casben79
    I am trying to enqueue a script from the functions.php file for a custom theme. here is the code I am using: wp_enqueue_script('innerfade','correct/path/to/innerfade.js', array('jquery'), '', false); I also tried to hardcode from the the functions file like so: ?> <script type='text/javascript' src="correct/path/to/innerfade.js"></script> <?php and both are outputting the following: correct/path/to/innerfade.js'?ver=2.9.2 so It doesnt seem to be a wp_enqueue_script problem What I cannot seem to figure is where the hell is the comma after the .js is coming from, it is causing a dead link hence not loading the script, anyone have any ideas??

    Read the article

  • Change width of element with mouseover jquery

    - by casben79
    I am trying to create a thin line under a nav bar to follow the mouse but am having trouble getting e.page:X to set the width of the element. Here is what I have: $('#test').mousemove(function(){ var linewidth = e.pageX; $("#line").width($linewidth); }) }) Can anyone tell me why this is not setting the width of #line

    Read the article

1