Jump to content

syed

Members
  • Posts

    151
  • Joined

  • Last visited

Posts posted by syed

  1. Hi guys, hope someone can help, Im having some problems spliting a string using the preg_split function. Basically im trying to split a string similar to this.

     

    x > 1

    Output needs to be array([0]=>x[1]=>>[2]=>1)

     

    I need a regex that can also split on

     

    x >= 1  or

    x <= 1 or

    x = 1 or

    x != 1

     

    Currently im using this, $regx = "/(<=|<|=|>|>=)/"; but for expressions like x >= 1  the returned array contains 2 elements one for each operator, I need just the one.

     

    Any help will be greately appreciated.

  2. Hi guys, I am developing an MVC application and need some advice about how to set up url routing. Currently I can map a uri to modules/controllers and actions. I though I might leave the routing to last but it seems like that might have been a bad idea. Initially I though I might implement a Zend style routing approach and I still want to do this, but I am lost for thoughs on how I might go about this, I have looked at the zend router classes and understand the principle but cant seem to implement it in my own mvc.

     

    So far I have this,

    $router is an instance of a router class. mapRoute takes a route name and a route object as parameters. The name will be used for convinience. The second parameter takes a route instance which currently takes two parameters, where param1 is a route pattern and param2 is deafult values for when a uri macthes the route pattern. So if a user types http://example/user/23,

     

    the router should map to user controller, profile action. The id, which is 23, will need to be injected into a request object. Finally the router object will be added to a front controller instance, so the front controller object can gain access to all the routes.

     

                    $router->mapRoute("user", new Route(
                                    "user/<id>",
                                    array(
                                        "controller"=>"user",
                                        "action"=>"profile"
                                    )
                                )
                    );
    

     

    If any one has any ideas please do share, im not after code, unless you want to supply some, I just need some advice to stream line the whole process or what the best way might be. Any help will be greatly appreciated.

  3. Bar Width and Bar Height is one word not 2

     

    BarWidth

    BarHeaigh

     

    in the array.

     

       $client = new SoapClient("http://www.barcodesoft.com/bcdgen.asmx?WSDL");
       $response = $client->UPCA(array(
                      'textToEncode'=>'9783540235606',
                      'ImageFormat'=>'PNG',
                      'strAddon'=>'',
                      'Orientation'=>'Original',
                      'BarWidth'=>'2',
                      'BarHeight'=>'10'
               ));
    
    print_r($response );
    

  4. It depends where the values for the meta data will be comming from. If all your data is stored in a database then you could construct your meta tags based on the page you are accessing, again it all depends on where the meta data is comming from. Do you have a db table that might be able to construct the meta data?

  5. Hi JZS, it seems to me you are planning a long term project, which will consists of many users. I would not suggest going with a framework becuase it is quick to develop a website. You need to think about the long term too, what happends if the framework you use no longer exists or is no longer supported in the future.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.